Skip to content

Commit 46ac3b0

Browse files
committed
some adjusts
1 parent 55a3ff3 commit 46ac3b0

File tree

10 files changed

+29
-19
lines changed

10 files changed

+29
-19
lines changed

components/printful/actions/calculate-shipping-rates/calculate-shipping-rates.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { LOCALE_OPTIONS } from "../../common/constants.mjs";
12
import { parseObject } from "../../common/utils.mjs";
23
import printful from "../../printful.app.mjs";
34

@@ -60,7 +61,8 @@ export default {
6061
locale: {
6162
type: "string",
6263
label: "Locale",
63-
description: "Locale in which shipping rate names will be returned. Available options: `en_US` (default), `es_ES`",
64+
description: "Locale in which shipping rate names will be returned",
65+
options: LOCALE_OPTIONS,
6466
optional: true,
6567
},
6668
},

components/printful/actions/create-order/create-order.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Order",
66
version: "0.0.1",
77
key: "printful-create-order",
8-
description: "Creates a new order in your Printful account. [See docs here](https://developers.printful.com/docs/#operation/createOrder)",
8+
description: "Creates a new order in your Printful account. [See the documentaion](https://developers.printful.com/docs/#operation/createOrder)",
99
type: "action",
1010
props: {
1111
printful,
@@ -98,7 +98,7 @@ export default {
9898
items: {
9999
label: "Items",
100100
description: "Array of items in the order. E.g. `[ { \"id\": 1, \"variant_id\": 2, \"quantity\": 3, \"price\": \"13.60\", \"retail_price\": \"9.90\", \"name\": \"Beauty Poster\", \"product\": { \"product_id\": 301, \"variant_id\": 500, \"name\": \"Red T-Shirt\" }, \"files\": [{\"url\": \"https://file.com/060b204a37f.png\"}] } ]`",
101-
type: "string",
101+
type: "string[]",
102102
},
103103
},
104104
additionalProps(props) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
export const LIMIT = 100;
2+
export const LOCALE_OPTIONS = [
3+
{
4+
label: "English (US)",
5+
value: "en_US",
6+
},
7+
{
8+
label: "Spanish (Spain)",
9+
value: "es_ES",
10+
},
11+
];

components/printful/printful.app.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default {
77
propDefinitions: {
88
storeId: {
99
type: "string",
10-
label: "Store Id",
11-
description: "The store id to use for the request",
10+
label: "Store ID",
11+
description: "Select a store or provide s store ID to use for the request",
1212
async options({ page }) {
1313
const { result } = await this.listStores({
1414
params: {
@@ -27,7 +27,7 @@ export default {
2727
},
2828
productId: {
2929
type: "string",
30-
label: "Product Id",
30+
label: "Product ID",
3131
description: "Sync Product ID (integer) or External ID (if prefixed with @)",
3232
async options({
3333
storeId, page,
@@ -64,13 +64,11 @@ export default {
6464
_makeRequest({
6565
$ = this, path, headers, ...opts
6666
}) {
67-
const config = {
67+
return axios($, {
6868
url: this._baseUrl() + path,
6969
headers: this._headers(headers),
7070
...opts,
71-
};
72-
console.log("config: ", config);
73-
return axios($, config);
71+
});
7472
},
7573
createOrder(opts = {}) {
7674
return this._makeRequest({

components/printful/sources/common/base.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
alert: {
1212
type: "alert",
1313
alertType: "warning",
14-
content: "**Note** that only one webhook URL can be active for a store, so calling this method disables all existing webhook configuration.",
14+
content: "**Note** that only one webhook URL can be active for a store, so all existing webhook configuration will be disabled upon creating this source.",
1515
},
1616
storeId: {
1717
propDefinition: [

components/printful/sources/new-order-instant/new-order-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs";
44
export default {
55
...common,
66
key: "printful-new-order-instant",
7-
name: "New Order (Instant)",
7+
name: "New Order Created (Instant)",
88
description: "Emit new event when a new order is created in your Printful account.",
99
version: "0.0.1",
1010
type: "source",

components/printful/sources/new-order-instant/test-event.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default {
107107
{
108108
"type": "default",
109109
"id": 10,
110-
"url": "https://www.example.com/files/tshirts/example.png",
110+
"url": "https://www.example.com/files/tshirts/example.png",
111111
"options": [
112112
{
113113
"id": "template_type",
@@ -208,7 +208,7 @@ export default {
208208
"email": "[email protected]",
209209
"phone": "+371 28888888",
210210
"message": "Message on packing slip",
211-
"logo_url": "http://www.your-domain.com/packing-logo.png",
211+
"logo_url": "http://www.your-domain.com/packing-logo.png",
212212
"store_name": "Your store name",
213213
"custom_order_id": "kkk2344lm"
214214
}

components/printful/sources/new-product-added-instant/test-event.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
"name": "T-shirt",
1111
"variants": 10,
1212
"synced": 10,
13-
"thumbnail_url": "https://your-domain.com/path/to/image.png",
13+
"thumbnail_url": "https://your-domain.com/path/to/image.png",
1414
"is_ignored": true
1515
}
1616
}

components/printful/sources/order-status-updated-instant/order-status-updated-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs";
44
export default {
55
...common,
66
key: "printful-order-status-updated-instant",
7-
name: "New Order Status Updated (Instant)",
7+
name: "Order Status Updated (Instant)",
88
description: "Emit new event when the status of an existing Printful order is updated.",
99
version: "0.0.1",
1010
type: "source",

components/printful/sources/order-status-updated-instant/test-event.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
{
5252
"type": "default",
5353
"id": 10,
54-
"url": "https://www.example.com/files/tshirts/example.png",
54+
"url": "https://www.example.com/files/tshirts/example.png",
5555
"options": [
5656
{
5757
"id": "template_type",
@@ -107,7 +107,7 @@ export default {
107107
{
108108
"type": "default",
109109
"id": 10,
110-
"url": "https://www.example.com/files/tshirts/example.png",
110+
"url": "https://www.example.com/files/tshirts/example.png",
111111
"options": [
112112
{
113113
"id": "template_type",
@@ -208,7 +208,7 @@ export default {
208208
"email": "[email protected]",
209209
"phone": "+371 28888888",
210210
"message": "Message on packing slip",
211-
"logo_url": "http://www.your-domain.com/packing-logo.png",
211+
"logo_url": "http://www.your-domain.com/packing-logo.png",
212212
"store_name": "Your store name",
213213
"custom_order_id": "kkk2344lm"
214214
}

0 commit comments

Comments
 (0)