-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTION] Shopify - new components #19401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,342
−38
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...nents/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import shopify from "../../shopify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "shopify-get-assigned-fulfillment-orders", | ||
| name: "Get Assigned Fulfillment Orders", | ||
| description: "Retrieve a list of fulfillment orders assigned to a merchant location. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/assignedfulfillmentorders)", | ||
| version: "0.0.3", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| shopify, | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| info: { | ||
| type: "alert", | ||
| alertType: "info", | ||
| content: "Please verify that the Shopify shop has fulfillment services properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)", | ||
| }, | ||
| sortKey: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "sortKey", | ||
| ], | ||
| description: "The key to sort the results by. Options: `ID`", | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| reverse: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "reverse", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const fulfillmentOrders = await this.shopify.getPaginated({ | ||
| resourceFn: this.shopify.listAssignedFulfillmentOrders, | ||
| resourceKeys: [ | ||
| "assignedFulfillmentOrders", | ||
| ], | ||
| variables: { | ||
| sortKey: this.sortKey, | ||
| reverse: this.reverse, | ||
| }, | ||
| max: this.maxResults, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${fulfillmentOrders.length} fulfillment order${fulfillmentOrders.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return fulfillmentOrders; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import shopify from "../../shopify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "shopify-get-customer", | ||
| name: "Get Customer", | ||
| description: "Retrieve a single customer by ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customer)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| shopify, | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| info: { | ||
| type: "alert", | ||
| alertType: "info", | ||
| content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", | ||
| }, | ||
| customerId: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "customerId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { customer } = await this.shopify.getCustomer({ | ||
| id: this.customerId, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved customer \`${customer.email || customer.id}\``); | ||
| return customer; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
67 changes: 67 additions & 0 deletions
67
components/shopify/actions/get-customers/get-customers.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import shopify from "../../shopify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "shopify-get-customers", | ||
| name: "Get Customers", | ||
| description: "Retrieve a list of customers. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers)", | ||
| version: "0.0.2", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| shopify, | ||
| // This app is not approved to access the Customer object. See https://shopify.dev/docs/apps/launch/protected-customer-data for more details." | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| info: { | ||
| type: "alert", | ||
| alertType: "info", | ||
| content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", | ||
| }, | ||
| query: { | ||
| type: "string", | ||
| label: "Query", | ||
| description: "The query string to filter customers. Example: `email:[email protected]` or `state:ENABLED`. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers#argument-customers-query)", | ||
| optional: true, | ||
| }, | ||
| sortKey: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "sortKey", | ||
| ], | ||
| description: "The key to sort the results by. Options: `CREATED_AT`, `ID`, `NAME`, `ORDERS_COUNT`, `STATE`, `TOTAL_SPENT`, `UPDATED_AT`", | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| reverse: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "reverse", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const customers = await this.shopify.getPaginated({ | ||
| resourceFn: this.shopify.listCustomers, | ||
| resourceKeys: [ | ||
| "customers", | ||
| ], | ||
| variables: { | ||
| query: this.query, | ||
| sortKey: this.sortKey, | ||
| reverse: this.reverse, | ||
| }, | ||
| max: this.maxResults, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${customers.length} customer${customers.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return customers; | ||
| }, | ||
| }; |
36 changes: 36 additions & 0 deletions
36
components/shopify/actions/get-draft-order/get-draft-order.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import shopify from "../../shopify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "shopify-get-draft-order", | ||
| name: "Get Draft Order", | ||
| description: "Retrieve a single draft order by ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/draftorder)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| shopify, | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| info: { | ||
| type: "alert", | ||
| alertType: "info", | ||
| content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| draftOrderId: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "draftOrderId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { draftOrder } = await this.shopify.getDraftOrder({ | ||
| id: this.draftOrderId, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved draft order \`${draftOrder.name || draftOrder.id}\``); | ||
| return draftOrder; | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.