@shipengine/connect-runtime
TypeScript icon, indicating that this package has built-in type declarations

4.6.2 • Public • Published

Installing, building

Install dependencies either at the repo root or in each package directory, eg /packages/connect-carrier-api

Install dependencies yarn

Build from the package directory yarn build

Order Source App

import { logger, NotImplementedError, start } from '@shipengine/connect-runtime';
import { OrderSourceApp, AuthenticationType, AcknowledgeOrdersRequest, AcknowledgeOrdersResponse, SalesOrdersExportRequest, SalesOrdersExportResponse, ShipmentNotificationRequest, ShipmentNotificationResponse } from '@shipengine/connect-order-source-api';
import { join } from 'path';

const SalesOrdersExport = (request: SalesOrdersExportRequest): Promise<SalesOrdersExportResponse> => {
    logger.info('This is a useless log');
    throw new NotImplementedError();
}
const ShipmentNotification = (request: ShipmentNotificationRequest): Promise<ShipmentNotificationResponse> => {
    throw new NotImplementedError();
}
const AcknowledgeOrders = (request: AcknowledgeOrdersRequest): Promise<AcknowledgeOrdersResponse> => {
    throw new NotImplementedError();
}

start(new OrderSourceApp({
    SalesOrdersExport,
    ShipmentNotification,
    AcknowledgeOrders,
    Metadata: {
        Id: '3bdd999b-ecf5-4915-b505-c8e665ce1f56',
        Name: 'Order Source API App',
        AuthProcess: {
            Identifier: {
                AuthenticationType: AuthenticationType.Basic,
                IsSandbox: false
            }
        },
        OrderSources: [{
            Id: '3440a3bf-cd22-494f-ad02-500b6cdcedb8',
            Name: 'Order Source API App',
            SendEmail: true,
            ScoreFactorForAutoRefresh: 0.1,
            CanRefresh: false,
            CanConfigureTimeZone: false,
            CanConfirmMultipleShipments: false,
            CanConfirmShipments: false,
            CanLeaveFeedback: true,
            HasCustomMappings: false,
            HasCustomStatuses: false,
            HasInventoryLevels: true,
            AccountConnection: {
                Name: 'OrderSource API App Connection Form',
                ConnectionFormSchema: {
                    JsonSchema: {
                        "type": "object",
                        "required": [
                            "username",
                            "password"
                        ],
                        "properties": {
                            "username": {
                                "type": "string",
                                "title": "User Name:"
                            },
                            "password": {
                                "type": "string",
                                "title": "Password:"
                            }
                        }
                    },
                    UiSchema: {
                        "password": {
                            "ui:widget": "password",
                            "ui:help": "Hint: Make it strong!"
                        }
                    }
                }
            }
        }]
    },
    Logo: join(__dirname, '../assets/logo.svg'),
    Icon: join(__dirname, '../assets/icon.svg'),
}));

Publishing

  • Update Version In package.json
  • Run npm run-script build
  • Run npm publish

This will publish the app to Nexus (our private repository)

Readme

Keywords

none

Package Sidebar

Install

npm i @shipengine/connect-runtime

Weekly Downloads

727

Version

4.6.2

License

Apache-2.0

Unpacked Size

136 kB

Total Files

42

Last publish

Collaborators

  • christian.casado
  • lzhang
  • lukasz.parala
  • deeepawesome
  • akowalczyk
  • ddygas
  • pspringerauct
  • dangnguyen91
  • arapicki
  • prasadjoshi29
  • zjaholkowska
  • maciej_sabik_auctane
  • kdobrzynskiactn
  • bmusielak
  • mmilowska
  • bartoszzurawski
  • mspiaczka-auctane
  • maciej_adamek
  • marcin_karwat_auctane
  • krzysztof.malcher
  • auctome
  • sushithegreat
  • agustin.martin.auctane
  • brock.bouchard.auctane
  • auctane.joshua.semar
  • romofel
  • chunter-auctane
  • luxehahn
  • jeffrysparrow
  • uiuxdeveloper
  • ckroutterauctane
  • shipengine_it
  • kaseycantu-se
  • joshuaflanagan
  • anthonyshull
  • binkard-auctane
  • dlblom
  • rickyr
  • dbernazal
  • auc-rhibbeler
  • harris.butler