@pipedream/taxjar 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,41 @@
1
- Copyright 2020 Pipedream, Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Pipedream Source Available License Version 1.0
2
+
3
+ This Pipedream Source Available License Agreement Version 1.0 (this “Agreement”) sets forth the terms on which Pipedream, Inc., a Delaware corporation (“Pipedream”) makes available certain software (the Software). By installing, downloading, accessing, using or distributing the Software, you agree to the terms of this Agreement. If you do not agree to such terms, you must not use the Software. If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this Agreement on behalf of such entity. “Licensee” means you, an individual, or the entity on whose behalf you are receiving the Software.
4
+
5
+ LICENSE GRANT AND CONDITIONS.
6
+
7
+ 1.1 License. Subject to the terms and conditions of this Agreement, Pipedream hereby grants to Licensee a non-exclusive, royalty-free, worldwide, non-transferable, non-sublicenseable license during the term of this Agreement to use, prepare modifications and derivative works, distribute (including without limitation in source code or object code form) and reproduce copies of the Software (the “License”). Licensee is not granted the right to, and Licensee shall not, exercise the License for an Excluded Purpose. For purposes of this Agreement, “Excluded Purpose” means any commercial use of the software including, but not limited to, making available any software-as-a-service, platform-as-a-service, infrastructure-as-a-service or other online service that competes with the Software or any other Pipedream products or services.
8
+
9
+ 1.2 Conditions. In consideration of the License, Licensee’s distribution of the Software is subject to the following conditions:
10
+
11
+ a. Licensee must cause any Software modified by Licensee to carry prominent notices stating that Licensee modified the Software.
12
+
13
+ b. On each Software copy, Licensee shall reproduce and not remove or alter all Pipedream or third party copyright or other proprietary notices contained in the Software, and Licensee must provide this with each copy: “This software is made available by Pipedream, Inc., under the terms of the Pipedream Source Available License, Version 1.0 located at https://github.com/PipedreamHQ/pipedream/blob/master/LICENSE. By installing, downloading, accessing, using or distributing the Software, you agree to the terms of such License Agreement.”
14
+
15
+ 1.3 Modifications. Licensee may add its own copyright notices to modifications made by Licensee and may provide additional or different license terms and conditions for use, reproduction, or distribution of Licensee’s modifications. While redistributing the Software or modifications thereof, Licensee may choose to offer, for a fee or free of charge, support, warranty, indemnity, or other obligations. Licensee, and not Pipedream, will be responsible for any such obligations.
16
+
17
+ 1.4 No Sublicensing. The License does not include the right to sublicense the Software; provided, however, that any recipient to which Licensee provides the Software may exercise the License so long as such recipient agrees to the terms and conditions of this Agreement.
18
+
19
+ TERM AND TERMINATION.
20
+
21
+ This Agreement will continue unless and until earlier terminated as set forth herein. If Licensee breaches any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the License will terminate automatically and permanently.
22
+
23
+ INTELLECTUAL PROPERTY.
24
+
25
+ As between the parties, Pipedream retains all right, title, and interest in the Software, and all intellectual property rights therein. Pipedream hereby reserves all rights not expressly granted to Licensee in this Agreement. Pipedream reserves all rights in its trademarks and service marks, and no licenses thereto are granted by this Agreement.
26
+
27
+ DISCLAIMER.
28
+
29
+ PIPEDREAM HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE.
30
+
31
+ LIMITATION OF LIABILITY.
32
+
33
+ PIPEDREAM WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
34
+
35
+ GENERAL.
36
+
37
+ 6.1 Governing Law. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If Licensee is located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS International Arbitration Rules. The tribunal will consist of one arbitrator. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. All disputes including arbitrations shall take place in Santa Clara County, California. The language to be used in any such proceedings shall be English.
38
+
39
+ 6.2. Assignment. Licensee is not authorized to assign its rights under this Agreement to any third party. Pipedream may freely assign its rights under this Agreement to any third party.
40
+
41
+ 6.3. Other. This Agreement is the entire agreement between the parties regarding the subject matter hereof. No amendment or modification of this Agreement will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Waiver by Pipedream of a breach of any provision of this Agreement or the failure by Pipedream to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right.
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Overview
2
+
3
+ The TaxJar API offers a suite of tools for automating sales tax calculations, reporting, and filings. With this API, you can get real-time sales tax rates and calculations at checkout, generate detailed sales tax reports for each state, and automate your sales tax filings. Integrating TaxJar with Pipedream allows you to create workflows that can enhance e-commerce platforms, financial systems, and accounting software, ensuring that sales tax handling is both accurate and effortless.
4
+
5
+ # Example Use Cases
6
+
7
+ - **Real-Time Sales Tax Calculation at Checkout**
8
+ Automatically calculate sales tax in Pipedream workflows for e-commerce orders. When a new order is received in Shopify, trigger a workflow that uses the TaxJar API to calculate the appropriate sales tax based on the customer’s location and the items purchased.
9
+
10
+ - **Monthly Sales Tax Reporting**
11
+ Schedule a Pipedream workflow that runs at the end of every month, summarizing total sales and taxes collected through Stripe. Use TaxJar to prepare the tax reports needed for filing, ensuring compliance with minimal manual effort.
12
+
13
+ - **Automated Tax Filing Reminders**
14
+ Combine the TaxJar API with Google Calendar in Pipedream to create workflows that remind you to file taxes before the due date. When TaxJar reports a nearing filing deadline, the workflow can create an event in your Google Calendar as a reminder.
@@ -0,0 +1,98 @@
1
+ import app from "../../taxjar.app.mjs";
2
+
3
+ export default {
4
+ key: "taxjar-calculate-sales-tax",
5
+ name: "Calculate Sales Tax",
6
+ description: "Shows the sales tax that should be collected for a given order. [See the documentation](https://developers.taxjar.com/api/reference/#taxes)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ app,
11
+ exemptionType: {
12
+ propDefinition: [
13
+ app,
14
+ "exemptionType",
15
+ ],
16
+ },
17
+ fromCountry: {
18
+ propDefinition: [
19
+ app,
20
+ "fromCountry",
21
+ ],
22
+ },
23
+ fromZip: {
24
+ propDefinition: [
25
+ app,
26
+ "fromZip",
27
+ ],
28
+ },
29
+ fromState: {
30
+ propDefinition: [
31
+ app,
32
+ "fromState",
33
+ ],
34
+ },
35
+ fromCity: {
36
+ propDefinition: [
37
+ app,
38
+ "fromCity",
39
+ ],
40
+ },
41
+ fromStreet: {
42
+ propDefinition: [
43
+ app,
44
+ "fromStreet",
45
+ ],
46
+ },
47
+ toCountry: {
48
+ propDefinition: [
49
+ app,
50
+ "toCountry",
51
+ ],
52
+ },
53
+ toZip: {
54
+ propDefinition: [
55
+ app,
56
+ "toZip",
57
+ ],
58
+ },
59
+ toState: {
60
+ propDefinition: [
61
+ app,
62
+ "toState",
63
+ ],
64
+ },
65
+ amount: {
66
+ propDefinition: [
67
+ app,
68
+ "amount",
69
+ ],
70
+ },
71
+ shipping: {
72
+ propDefinition: [
73
+ app,
74
+ "shipping",
75
+ ],
76
+ },
77
+ },
78
+ async run({ $ }) {
79
+ const response = await this.app.calculateSalesTax({
80
+ $,
81
+ data: {
82
+ exemption_type: this.exemptionType,
83
+ from_country: this.fromCountry,
84
+ from_zip: this.fromZip,
85
+ from_state: this.fromState,
86
+ from_city: this.fromCity,
87
+ from_street: this.fromStreet,
88
+ to_country: this.toCountry,
89
+ to_zip: this.toZip,
90
+ to_state: this.toState,
91
+ amount: this.amount,
92
+ shipping: this.shipping,
93
+ },
94
+ });
95
+ $.export("$summary", `Successfully calculated sales tax. Amount to collect: ${response.tax.amount_to_collect}`);
96
+ return response;
97
+ },
98
+ };
@@ -0,0 +1,82 @@
1
+ import app from "../../taxjar.app.mjs";
2
+
3
+ export default {
4
+ key: "taxjar-create-customer",
5
+ name: "Create Customer",
6
+ description: "Creates a new customer at TaxJar. [See the documentation](https://developers.taxjar.com/api/reference/#post-create-a-customer)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ app,
11
+ customerId: {
12
+ propDefinition: [
13
+ app,
14
+ "customerId",
15
+ ],
16
+ },
17
+ exemptionType: {
18
+ propDefinition: [
19
+ app,
20
+ "exemptionType",
21
+ ],
22
+ },
23
+ name: {
24
+ propDefinition: [
25
+ app,
26
+ "name",
27
+ ],
28
+ },
29
+ country: {
30
+ propDefinition: [
31
+ app,
32
+ "country",
33
+ ],
34
+ optional: true,
35
+ },
36
+ state: {
37
+ propDefinition: [
38
+ app,
39
+ "state",
40
+ ],
41
+ optional: true,
42
+ },
43
+ zip: {
44
+ propDefinition: [
45
+ app,
46
+ "zip",
47
+ ],
48
+ optional: true,
49
+ },
50
+ city: {
51
+ propDefinition: [
52
+ app,
53
+ "city",
54
+ ],
55
+ optional: true,
56
+ },
57
+ street: {
58
+ propDefinition: [
59
+ app,
60
+ "street",
61
+ ],
62
+ optional: true,
63
+ },
64
+ },
65
+ async run({ $ }) {
66
+ const response = await this.app.createCustomer({
67
+ $,
68
+ data: {
69
+ customer_id: this.customerId,
70
+ exemption_type: this.exemptionType,
71
+ name: this.name,
72
+ country: this.country,
73
+ state: this.state,
74
+ zip: this.zip,
75
+ city: this.city,
76
+ street: this.street,
77
+ },
78
+ });
79
+ $.export("$summary", `Successfully created customer with ID ${this.customerId}`);
80
+ return response;
81
+ },
82
+ };
@@ -0,0 +1,62 @@
1
+ import app from "../../taxjar.app.mjs";
2
+
3
+ export default {
4
+ key: "taxjar-validate-address",
5
+ name: "Validate Address",
6
+ description: "Validates a customer address and returns back a collection of address matches. [See the documentation](https://developers.taxjar.com/api/reference/#post-validate-an-address)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ app,
11
+ country: {
12
+ propDefinition: [
13
+ app,
14
+ "country",
15
+ ],
16
+ description: "The two-letter ISO country code, i.e.: `US`. At this time only US addresses can be validated",
17
+ optional: true,
18
+ },
19
+ state: {
20
+ propDefinition: [
21
+ app,
22
+ "state",
23
+ ],
24
+ optional: true,
25
+ },
26
+ zip: {
27
+ propDefinition: [
28
+ app,
29
+ "zip",
30
+ ],
31
+ optional: true,
32
+ },
33
+ city: {
34
+ propDefinition: [
35
+ app,
36
+ "city",
37
+ ],
38
+ optional: true,
39
+ },
40
+ street: {
41
+ propDefinition: [
42
+ app,
43
+ "street",
44
+ ],
45
+ optional: true,
46
+ },
47
+ },
48
+ async run({ $ }) {
49
+ const response = await this.app.validateAddress({
50
+ $,
51
+ data: {
52
+ country: this.country,
53
+ state: this.state,
54
+ zip: this.zip,
55
+ city: this.city,
56
+ street: this.street,
57
+ },
58
+ });
59
+ $.export("$summary", `Successfully sent the request and found ${response.addresses.length} address matches`);
60
+ return response;
61
+ },
62
+ };
@@ -0,0 +1,8 @@
1
+ export default {
2
+ EXEMPTION_TYPES: [
3
+ "wholesale",
4
+ "government",
5
+ "other",
6
+ "non_exempt",
7
+ ],
8
+ };
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@pipedream/taxjar",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Pipedream TaxJar Components",
5
- "main": "dist/app/taxjar.app.mjs",
5
+ "main": "taxjar.app.mjs",
6
6
  "keywords": [
7
7
  "pipedream",
8
8
  "taxjar"
9
9
  ],
10
- "files": [
11
- "dist"
12
- ],
13
10
  "homepage": "https://pipedream.com/apps/taxjar",
14
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
15
- "license": "MIT",
16
12
  "publishConfig": {
17
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/platform": "^3.0.3"
18
17
  }
19
18
  }
package/taxjar.app.mjs ADDED
@@ -0,0 +1,142 @@
1
+ import { axios } from "@pipedream/platform";
2
+ import constants from "./common/constants.mjs";
3
+
4
+ export default {
5
+ type: "app",
6
+ app: "taxjar",
7
+ propDefinitions: {
8
+ customerId: {
9
+ type: "string",
10
+ label: "Customer ID",
11
+ description: "Unique identifier for the customer",
12
+ },
13
+ exemptionType: {
14
+ type: "string",
15
+ label: "Exemption Type",
16
+ description: "The type of tax exemption for the customer",
17
+ options: constants.EXEMPTION_TYPES,
18
+ },
19
+ name: {
20
+ type: "string",
21
+ label: "Name",
22
+ description: "The name of the customer",
23
+ },
24
+ country: {
25
+ type: "string",
26
+ label: "Country",
27
+ description: "The two-letter ISO country code, i.e.: `US`",
28
+ },
29
+ state: {
30
+ type: "string",
31
+ label: "State",
32
+ description: "The two-letter ISO state code, i.e.: `CA`",
33
+ },
34
+ zip: {
35
+ type: "string",
36
+ label: "Zip",
37
+ description: "The ZIP code of the customer's primary address, i.e.: `92093`",
38
+ },
39
+ city: {
40
+ type: "string",
41
+ label: "City",
42
+ description: "The city of the customer's primary address, i.e.: `La Jolla`",
43
+ },
44
+ street: {
45
+ type: "string",
46
+ label: "Street",
47
+ description: "The street of the customer's primary address, i.e.: `9500 Gilman Drive`",
48
+ },
49
+ fromCountry: {
50
+ type: "string",
51
+ label: "From Country",
52
+ description: "The two-letter ISO country code of the country where the order shipped from, i.e.: `US`",
53
+ },
54
+ fromZip: {
55
+ type: "string",
56
+ label: "From Zip",
57
+ description: "The postal code where the order shipped from, i.e.: `92093`",
58
+ },
59
+ fromState: {
60
+ type: "string",
61
+ label: "From State",
62
+ description: "The two-letter ISO state code where the order shipped from, i.e.: `CA`",
63
+ },
64
+ fromCity: {
65
+ type: "string",
66
+ label: "From City",
67
+ description: "The city where the order shipped from, i.e.: `La Jolla`",
68
+ },
69
+ fromStreet: {
70
+ type: "string",
71
+ label: "From Street",
72
+ description: "The street address where the order shipped from, i.e.: `9500 Gilman Drive`",
73
+ },
74
+ toCountry: {
75
+ type: "string",
76
+ label: "To Country",
77
+ description: "The two-letter ISO country code of the country where the order shipped to, i.e.: `US`",
78
+ },
79
+ toZip: {
80
+ type: "string",
81
+ label: "To Zip",
82
+ description: "The postal code where the order shipped to, i.e.: `92093`",
83
+ },
84
+ toState: {
85
+ type: "string",
86
+ label: "To State",
87
+ description: "The two-letter ISO state code where the order shipped yo, i.e.: `CA`",
88
+ },
89
+ amount: {
90
+ type: "string",
91
+ label: "Amount",
92
+ description: "Total amount of the order, excluding shipping",
93
+ },
94
+ shipping: {
95
+ type: "string",
96
+ label: "Shipping",
97
+ description: "Total amount of shipping for the order",
98
+ },
99
+ },
100
+ methods: {
101
+ _baseUrl() {
102
+ return "https://api.taxjar.com/v2";
103
+ },
104
+ async _makeRequest(opts = {}) {
105
+ const {
106
+ $ = this,
107
+ path,
108
+ headers,
109
+ ...otherOpts
110
+ } = opts;
111
+ return axios($, {
112
+ ...otherOpts,
113
+ url: this._baseUrl() + path,
114
+ headers: {
115
+ Authorization: `Bearer ${this.$auth.api_key}`,
116
+ ...headers,
117
+ },
118
+ });
119
+ },
120
+ async createCustomer(args = {}) {
121
+ return this._makeRequest({
122
+ path: "/customers",
123
+ method: "post",
124
+ ...args,
125
+ });
126
+ },
127
+ async calculateSalesTax(args = {}) {
128
+ return this._makeRequest({
129
+ path: "/taxes",
130
+ method: "post",
131
+ ...args,
132
+ });
133
+ },
134
+ async validateAddress(args = {}) {
135
+ return this._makeRequest({
136
+ path: "/addresses/validate",
137
+ method: "post",
138
+ ...args,
139
+ });
140
+ },
141
+ },
142
+ };