Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/clarifai/clarifai.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/cloud_66/cloud_66.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/codefresh/codefresh.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/coinapi/coinapi.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/cometapi/cometapi.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/copicake/copicake.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/cronly/cronly.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/crossmint/crossmint.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/hex/hex.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/piwik_pro/piwik_pro.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/topdesk/topdesk.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
173 changes: 173 additions & 0 deletions components/ups/actions/create-shipment/create-shipment.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
import ups from "../../ups.app.mjs";
import constants from "../../common/constants.mjs";

export default {
key: "ups-create-shipment",
name: "Create Shipment",
description: "Create a new shipment. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/Shipment)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
ups,
shipperName: {
type: "string",
label: "Shipper Name",
description: "The name of the shipper",
},
shipperNumber: {
type: "string",
label: "Shipper Number",
description: "Shipper's six digit alphanumeric account number",
},
shipperAddressLine: {
type: "string",
label: "Shipper Address Line",
description: "The address line of the shipper",
},
shipperCity: {
type: "string",
label: "Shipper City",
description: "The city of the shipper",
},
shipperStateProvinceCode: {
type: "string",
label: "Shipper State Province Code",
description: "The state province code of the shipper",
},
shipperPostalCode: {
type: "string",
label: "Shipper Postal Code",
description: "The postal code of the shipper",
},
shipperCountryCode: {
type: "string",
label: "Shipper Country Code",
description: "The country code of the shipper",
},
shipToName: {
type: "string",
label: "Ship To Name",
description: "The name of the ship to",
},
shipToAddressLine: {
type: "string",
label: "Ship To Address Line",
description: "The address line of the ship to",
},
shipToCity: {
type: "string",
label: "Ship To City",
description: "The city of the ship to",
},
shipToStateProvinceCode: {
type: "string",
label: "Ship To State Province Code",
description: "The state province code of the ship to",
},
shipToPostalCode: {
type: "string",
label: "Ship To Postal Code",
description: "The postal code of the ship to",
},
shipToCountryCode: {
type: "string",
label: "Ship To Country Code",
description: "The country code of the ship to",
},
serviceCode: {
type: "string",
label: "Service Code",
description: "The code of the service",
options: constants.SERVICE_CODES,
},
packagingCode: {
type: "string",
label: "Packaging Code",
description: "The code of the packaging",
options: constants.PACKAGING_CODES,
},
weightUnit: {
type: "string",
label: "Weight Unit",
description: "The unit of weight for the package",
options: [
"LBS",
"KGS",
"OZS",
],
},
packageWeight: {
type: "string",
label: "Package Weight",
description: "The weight of the package",
},
},
async run({ $ }) {
const response = await this.ups.createShipment({
$,
data: {
ShipmentRequest: {
Request: {
RequestOption: "nonvalidate",
},
Shipment: {
Shipper: {
Name: this.shipperName,
ShipperNumber: this.shipperNumber,
Address: {
AddressLine: this.shipperAddressLine,
City: this.shipperCity,
StateProvinceCode: this.shipperStateProvinceCode,
PostalCode: this.shipperPostalCode,
CountryCode: this.shipperCountryCode,
},
},
ShipTo: {
Name: this.shipToName,
Address: {
AddressLine: this.shipToAddressLine,
City: this.shipToCity,
StateProvinceCode: this.shipToStateProvinceCode,
PostalCode: this.shipToPostalCode,
CountryCode: this.shipToCountryCode,
},
},
PaymentInformation: {
ShipmentCharge: [
{
Type: "01", // Transportation Charge
BillShipper: {
AccountNumber: this.shipperNumber,
},
},
],
},
Service: {
Code: this.serviceCode,
},
Package: [
{
Packaging: {
Code: this.packagingCode,
},
PackageWeight: {
UnitOfMeasurement: {
Code: this.weightUnit,
},
Weight: this.packageWeight,
},
},
],
},
},
},
});
$.export("$summary", "Shipment created successfully");
return response;
},
};
32 changes: 32 additions & 0 deletions components/ups/actions/get-tracking-info/get-tracking-info.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ups from "../../ups.app.mjs";

export default {
key: "ups-get-tracking-info",
name: "Get Tracking Info",
description: "Get tracking information for a UPS tracking number. [See the documentation](https://developer.ups.com/tag/Tracking?loc=en_US#operation/getSingleTrackResponseUsingGET)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
ups,
trackingNumber: {
propDefinition: [
ups,
"trackingNumber",
],
},
},
async run({ $ }) {
const response = await this.ups.getTrackingInfo({
$,
trackingNumber: this.trackingNumber,
});

$.export("$summary", `Successfully retrieved tracking information for ${this.trackingNumber}`);
return response;
},
};
39 changes: 39 additions & 0 deletions components/ups/actions/recover-label/recover-label.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import ups from "../../ups.app.mjs";

export default {
key: "ups-recover-label",
name: "Recover Label",
description: "Recover a label. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/LabelRecovery)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
ups,
trackingNumber: {
propDefinition: [
ups,
"trackingNumber",
],
},
},
async run({ $ }) {
const response = await this.ups.recoverLabel({
$,
data: {
LabelRecoveryRequest: {
Request: {
SubVersion: "1903",
},
TrackingNumber: this.trackingNumber,
},
},
});

$.export("$summary", `Successfully recovered label for shipment with tracking number ${this.trackingNumber}`);
return response;
},
};
32 changes: 32 additions & 0 deletions components/ups/actions/void-shipment/void-shipment.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ups from "../../ups.app.mjs";

export default {
key: "ups-void-shipment",
name: "Void Shipment",
description: "Void a shipment. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/VoidShipment)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
ups,
trackingNumber: {
propDefinition: [
ups,
"trackingNumber",
],
},
},
async run({ $ }) {
const response = await this.ups.voidShipment({
$,
trackingNumber: this.trackingNumber,
});

$.export("$summary", `Successfully voided shipment with tracking number ${this.trackingNumber}`);
return response;
},
};
Loading
Loading