Skip to content

Commit 4cbbb62

Browse files
authored
Merging pull request #18833
* wip * wip * remove source * pnpm-lock.yaml * fix base url to use production url
1 parent 8e075d6 commit 4cbbb62

File tree

13 files changed

+599
-13
lines changed

13 files changed

+599
-13
lines changed

components/clarifai/clarifai.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/codefresh/codefresh.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/cometapi/cometapi.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/hex/hex.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/piwik_pro/piwik_pro.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
import ups from "../../ups.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "ups-create-shipment",
6+
name: "Create Shipment",
7+
description: "Create a new shipment. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/Shipment)",
8+
version: "0.0.1",
9+
type: "action",
10+
annotations: {
11+
destructiveHint: false,
12+
openWorldHint: true,
13+
readOnlyHint: false,
14+
},
15+
props: {
16+
ups,
17+
shipperName: {
18+
type: "string",
19+
label: "Shipper Name",
20+
description: "The name of the shipper",
21+
},
22+
shipperNumber: {
23+
type: "string",
24+
label: "Shipper Number",
25+
description: "Shipper's six digit alphanumeric account number",
26+
},
27+
shipperAddressLine: {
28+
type: "string",
29+
label: "Shipper Address Line",
30+
description: "The address line of the shipper",
31+
},
32+
shipperCity: {
33+
type: "string",
34+
label: "Shipper City",
35+
description: "The city of the shipper",
36+
},
37+
shipperStateProvinceCode: {
38+
type: "string",
39+
label: "Shipper State Province Code",
40+
description: "The state province code of the shipper",
41+
},
42+
shipperPostalCode: {
43+
type: "string",
44+
label: "Shipper Postal Code",
45+
description: "The postal code of the shipper",
46+
},
47+
shipperCountryCode: {
48+
type: "string",
49+
label: "Shipper Country Code",
50+
description: "The country code of the shipper",
51+
},
52+
shipToName: {
53+
type: "string",
54+
label: "Ship To Name",
55+
description: "The name of the ship to",
56+
},
57+
shipToAddressLine: {
58+
type: "string",
59+
label: "Ship To Address Line",
60+
description: "The address line of the ship to",
61+
},
62+
shipToCity: {
63+
type: "string",
64+
label: "Ship To City",
65+
description: "The city of the ship to",
66+
},
67+
shipToStateProvinceCode: {
68+
type: "string",
69+
label: "Ship To State Province Code",
70+
description: "The state province code of the ship to",
71+
},
72+
shipToPostalCode: {
73+
type: "string",
74+
label: "Ship To Postal Code",
75+
description: "The postal code of the ship to",
76+
},
77+
shipToCountryCode: {
78+
type: "string",
79+
label: "Ship To Country Code",
80+
description: "The country code of the ship to",
81+
},
82+
serviceCode: {
83+
type: "string",
84+
label: "Service Code",
85+
description: "The code of the service",
86+
options: constants.SERVICE_CODES,
87+
},
88+
packagingCode: {
89+
type: "string",
90+
label: "Packaging Code",
91+
description: "The code of the packaging",
92+
options: constants.PACKAGING_CODES,
93+
},
94+
weightUnit: {
95+
type: "string",
96+
label: "Weight Unit",
97+
description: "The unit of weight for the package",
98+
options: [
99+
"LBS",
100+
"KGS",
101+
"OZS",
102+
],
103+
},
104+
packageWeight: {
105+
type: "string",
106+
label: "Package Weight",
107+
description: "The weight of the package",
108+
},
109+
},
110+
async run({ $ }) {
111+
const response = await this.ups.createShipment({
112+
$,
113+
data: {
114+
ShipmentRequest: {
115+
Request: {
116+
RequestOption: "nonvalidate",
117+
},
118+
Shipment: {
119+
Shipper: {
120+
Name: this.shipperName,
121+
ShipperNumber: this.shipperNumber,
122+
Address: {
123+
AddressLine: this.shipperAddressLine,
124+
City: this.shipperCity,
125+
StateProvinceCode: this.shipperStateProvinceCode,
126+
PostalCode: this.shipperPostalCode,
127+
CountryCode: this.shipperCountryCode,
128+
},
129+
},
130+
ShipTo: {
131+
Name: this.shipToName,
132+
Address: {
133+
AddressLine: this.shipToAddressLine,
134+
City: this.shipToCity,
135+
StateProvinceCode: this.shipToStateProvinceCode,
136+
PostalCode: this.shipToPostalCode,
137+
CountryCode: this.shipToCountryCode,
138+
},
139+
},
140+
PaymentInformation: {
141+
ShipmentCharge: [
142+
{
143+
Type: "01", // Transportation Charge
144+
BillShipper: {
145+
AccountNumber: this.shipperNumber,
146+
},
147+
},
148+
],
149+
},
150+
Service: {
151+
Code: this.serviceCode,
152+
},
153+
Package: [
154+
{
155+
Packaging: {
156+
Code: this.packagingCode,
157+
},
158+
PackageWeight: {
159+
UnitOfMeasurement: {
160+
Code: this.weightUnit,
161+
},
162+
Weight: this.packageWeight,
163+
},
164+
},
165+
],
166+
},
167+
},
168+
},
169+
});
170+
$.export("$summary", "Shipment created successfully");
171+
return response;
172+
},
173+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import ups from "../../ups.app.mjs";
2+
3+
export default {
4+
key: "ups-get-tracking-info",
5+
name: "Get Tracking Info",
6+
description: "Get tracking information for a UPS tracking number. [See the documentation](https://developer.ups.com/tag/Tracking?loc=en_US#operation/getSingleTrackResponseUsingGET)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ups,
16+
trackingNumber: {
17+
propDefinition: [
18+
ups,
19+
"trackingNumber",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.ups.getTrackingInfo({
25+
$,
26+
trackingNumber: this.trackingNumber,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved tracking information for ${this.trackingNumber}`);
30+
return response;
31+
},
32+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import ups from "../../ups.app.mjs";
2+
3+
export default {
4+
key: "ups-recover-label",
5+
name: "Recover Label",
6+
description: "Recover a label. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/LabelRecovery)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ups,
16+
trackingNumber: {
17+
propDefinition: [
18+
ups,
19+
"trackingNumber",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.ups.recoverLabel({
25+
$,
26+
data: {
27+
LabelRecoveryRequest: {
28+
Request: {
29+
SubVersion: "1903",
30+
},
31+
TrackingNumber: this.trackingNumber,
32+
},
33+
},
34+
});
35+
36+
$.export("$summary", `Successfully recovered label for shipment with tracking number ${this.trackingNumber}`);
37+
return response;
38+
},
39+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import ups from "../../ups.app.mjs";
2+
3+
export default {
4+
key: "ups-void-shipment",
5+
name: "Void Shipment",
6+
description: "Void a shipment. [See the documentation](https://developer.ups.com/tag/Shipping?loc=en_US#operation/VoidShipment)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: true,
11+
openWorldHint: true,
12+
readOnlyHint: false,
13+
},
14+
props: {
15+
ups,
16+
trackingNumber: {
17+
propDefinition: [
18+
ups,
19+
"trackingNumber",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.ups.voidShipment({
25+
$,
26+
trackingNumber: this.trackingNumber,
27+
});
28+
29+
$.export("$summary", `Successfully voided shipment with tracking number ${this.trackingNumber}`);
30+
return response;
31+
},
32+
};

0 commit comments

Comments
 (0)