1.53.0 • Published 10 months ago

nomad_pilot_cli v1.53.0

Weekly downloads
135
License
Unlicense
Repository
-
Last release
10 months ago

nomad_pilot_cli

NomadPilotCli - JavaScript client for nomad_pilot_cli This is the API descriptor for the Nomad Pilot API, responsible for shipping and logistics processing. Developed by Samarkand Global in partnership with SF Express, eSinotrans, sto. Read the documentation online at Nomad API Suite.

  • Install for node with npm install nomad_pilot_cli
  • Install for python with pip install nomad-pilot-cli
  • Install for Maven users groupId, com.gitlab.samarkand-nomad; artifactId, nomad-pilot-cli This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.53.0

  • Package version: 1.53.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install nomad_pilot_cli --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your nomad_pilot_cli from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
rules: [
{
parser: {
amd: false
}
}
]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

const nomadPilotCli = require("/nomad_javascript_client");

var defaultClient = nomadPilotCli.ApiClient.instance;
defaultClient.defaultHeaders["x-ca-stage"] = "test";
defaultClient.defaultHeaders["Authorization"] = "APPCODE " +
    process.env["ALICLOUD_APIGATEWAY_APP_API_KEY"];

var api = new nomadPilotCli.ShipApi();
var carrier = "samarkand.sinotrans.test";

const packageData = {
    "orderRef": "CHT1542019685",
    "sellerOrderRef": "Iceland123456",
    "currency": "RMB",
    "dimension": { "weight": 0.49, "height": 1, "length": 1, "width": 1 },
    "items": [
        { "name": "综合维生素片", "barcode": null, "quantity": 6, "price": 150, "brand": null,
        "quantityUom": "50G", "hsCode": "2104200000", "countryOfOrigin": "United States", "goldjet": { "goodsPtcode": "27000000" } },
        { "name": "牙膏", "barcode": null, "quantity": 3, "price": 10, "brand": null,
        "quantityUom": "50G", "hsCode": "2104200000", "countryOfOrigin": "United States", "goldjet": { "goodsPtcode": "27000000" } }],
    "shipFrom": { "firstName": "Zonghai", "lastName": "Liang", "address1": "6804 NE 79th Ct.", "address2": "foobar", "city": "纽约", "state": "纽约州", "country": "US", "zip": "EC1N 2SW", "tin": "tin", "phone": "123456", "countryCode": "US", "email": "a@b.com" },
    "shipTo": { "firstName": "小", "lastName": "张", "address1": "天河区^^^中山大道", "address2": null, "city": "广州市", "state": "广东省", "country": "CN", "zip": "1000", "tin": null, "phone": "123456", "countryCode": null, "email": "a@b.com" },
    "bill": { "firstName": "小明", "lastName": "王", "address1": "天河区^^^中山大道", "address2": null, "city": "广州市", "state": "广东省", "country": "CN", "zip": null, "tin": null, "phone": "123456", "countryCode": null, "email": "a@b.com" }
};
var pkg = new nomadPilotCli.ModelPackage.constructFromObject(packageData);
pkg.orderRef += Date.now()
//  https://jsrun.net/app/sfz
pkg.shipTo.idCard = "420101197301115218"
pkg.bill.idCard = "42010119940927595X"

var callback = function (error, data, response) {
    if (error) {
        console.error(error);
    } else {
        console.log("API called successfully. Returned data: " + data.data);
        console.log(data);
    }
};
/* POST */
api.ship(carrier, pkg, callback);

/* GET */
api.queryShip(carrier, pkg.orderRef, pkg.sellerOrderRef, callback);

/* DELETE */
api.cancelShip(carrier, pkg.orderRef, callback);

Documentation for API Endpoints

All URIs are relative to https://nomad.samarkand-global.cn/pilot

ClassMethodHTTP requestDescription
NomadPilotCli.BatchApiaddParcelPOST /ship/{carrier}/batch/{batch_id}/add-to-batchbatch
NomadPilotCli.BatchApicreateBatchPOST /ship/{carrier}/create-batchbatch
NomadPilotCli.BatchApiremoveParcelPOST /ship/{carrier}/batch/{batch_id}/remove-from-batchbatch
NomadPilotCli.BatchApiscanBatchPOST /ship/{carrier}/batch/{batch_id}/create-scan-formbatch
NomadPilotCli.CallbackApicallbackPOST /callback/{store}callback
NomadPilotCli.CarriersApiqueryCarrierGET /carriers/queryCarrier
NomadPilotCli.FreightForwardApifreightForwardPOST /freight-forward/{carrier}freightForward
NomadPilotCli.FreightForwardApiputFreightForwardProductPUT /freight-forward/product/{carrier}freightForward
NomadPilotCli.FreightForwardApiqueryFreightForwardGET /freight-forward/{carrier}queryFreightForward
NomadPilotCli.InventoryApigetInventoryProductGET /inventory/product/{carrier}inventory
NomadPilotCli.InventoryApipostInventoryProductPOST /inventory/product/{carrier}inventory
NomadPilotCli.InventoryApiputInventoryProductPUT /inventory/product/{carrier}inventory
NomadPilotCli.InventoryPurchaseApideleteInventoryPurchaseDELETE /inventory/purchase/{carrier}inventory_purchase
NomadPilotCli.InventoryPurchaseApigetInventoryPurchaseGET /inventory/purchase/{carrier}inventory_purchase
NomadPilotCli.InventoryPurchaseApipostInventoryPurchasePOST /inventory/purchase/{carrier}inventory_purchase
NomadPilotCli.QuickShipApiquickShipPOST /quick-ship/{carrier}quickShip
NomadPilotCli.ShipApicancelShipDELETE /ship/{carrier}/order/{seller_order_ref}cancelShip
NomadPilotCli.ShipApiputShipPUT /ship/{carrier}ship
NomadPilotCli.ShipApiqueryShipGET /ship/{carrier}/order/{seller_order_ref}queryShip
NomadPilotCli.ShipApishipPOST /ship/{carrier}ship
NomadPilotCli.ShipConfirmApishipConfirmPOST /ship/{carrier}/confirmshipConfirm

Documentation for Models

Documentation for Authorization

ca_key

  • Type: API key
  • API key parameter name: x-ca-key
  • Location: HTTP header

ca_stage

  • Type: API key
  • API key parameter name: x-ca-stage
  • Location: HTTP header
1.53.0

10 months ago

1.52.0

1 year ago

1.50.0

2 years ago

1.48.0

2 years ago

1.44.21

2 years ago

1.46.0

2 years ago

1.44.2

2 years ago

1.45.0

2 years ago

1.47.0

2 years ago

1.43.1

3 years ago

1.43.0

3 years ago

1.42.0

3 years ago

1.41.0

3 years ago

1.39.0

3 years ago

1.40.0

3 years ago

1.38.0

3 years ago

1.37.0

3 years ago

1.36.1

3 years ago

1.36.0

3 years ago

1.35.0

3 years ago

1.34.0

3 years ago

1.33.2

3 years ago

1.32.0

3 years ago

1.31.0

4 years ago

1.30.1

4 years ago

1.30.0

4 years ago

1.29.1

4 years ago

1.29.0

4 years ago

1.28.0

4 years ago

1.27.0

4 years ago

1.26.0

4 years ago

2.0.0

4 years ago

1.25.0

4 years ago

1.24.0

4 years ago

1.23.0

4 years ago

1.22.2

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

0.0.1

5 years ago