rutter-ts 0.3.2 → 0.3.4
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/dist/api.cjs +22 -16
- package/dist/api.d.cts +141 -1
- package/dist/api.d.ts +141 -1
- package/dist/api.js +22 -16
- package/package.json +1 -1
package/dist/api.cjs
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkLPP3MIOV_cjs = require('./chunk-LPP3MIOV.cjs');
|
|
4
4
|
var chunkJCJXW7AE_cjs = require('./chunk-JCJXW7AE.cjs');
|
|
5
|
-
var
|
|
5
|
+
var z = require('zod');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var z__default = /*#__PURE__*/_interopDefault(z);
|
|
10
10
|
|
|
11
|
+
var zGetAccessTokenConnectionResponse2 = chunkJCJXW7AE_cjs.zGetAccessTokenConnectionResponse.extend({
|
|
12
|
+
connection: chunkJCJXW7AE_cjs.zGetAccessTokenConnectionResponse.shape.connection.extend({
|
|
13
|
+
initial_orders_synced_count: z__default.default.number().nullish(),
|
|
14
|
+
disabled_reason: z__default.default.string().nullish()
|
|
15
|
+
})
|
|
16
|
+
});
|
|
11
17
|
var RutterConnectionsApi = class {
|
|
12
18
|
constructor(client) {
|
|
13
19
|
this.client = client;
|
|
@@ -22,7 +28,7 @@ var RutterConnectionsApi = class {
|
|
|
22
28
|
if (!result.success) {
|
|
23
29
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
24
30
|
endpoint,
|
|
25
|
-
|
|
31
|
+
z__default.default.prettifyError(result.error)
|
|
26
32
|
);
|
|
27
33
|
}
|
|
28
34
|
return result.data;
|
|
@@ -34,21 +40,21 @@ var RutterConnectionsApi = class {
|
|
|
34
40
|
if (!result.success) {
|
|
35
41
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
36
42
|
endpoint,
|
|
37
|
-
|
|
43
|
+
z__default.default.prettifyError(result.error)
|
|
38
44
|
);
|
|
39
45
|
}
|
|
40
46
|
return result.data;
|
|
41
47
|
}
|
|
42
48
|
async get(accessToken) {
|
|
43
|
-
const endpoint = "/connections";
|
|
49
|
+
const endpoint = "/connections/access_token";
|
|
44
50
|
const response = await this.client.get(endpoint, {
|
|
45
51
|
access_token: accessToken
|
|
46
52
|
});
|
|
47
|
-
const result =
|
|
53
|
+
const result = zGetAccessTokenConnectionResponse2.safeParse(response);
|
|
48
54
|
if (!result.success) {
|
|
49
55
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
50
56
|
endpoint,
|
|
51
|
-
|
|
57
|
+
z__default.default.prettifyError(result.error)
|
|
52
58
|
);
|
|
53
59
|
}
|
|
54
60
|
return result.data;
|
|
@@ -60,7 +66,7 @@ var RutterConnectionsApi = class {
|
|
|
60
66
|
if (!result.success) {
|
|
61
67
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
62
68
|
endpoint,
|
|
63
|
-
|
|
69
|
+
z__default.default.prettifyError(result.error)
|
|
64
70
|
);
|
|
65
71
|
}
|
|
66
72
|
return result.data;
|
|
@@ -74,7 +80,7 @@ var RutterConnectionsApi = class {
|
|
|
74
80
|
if (!result.success) {
|
|
75
81
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
76
82
|
endpoint,
|
|
77
|
-
|
|
83
|
+
z__default.default.prettifyError(result.error)
|
|
78
84
|
);
|
|
79
85
|
}
|
|
80
86
|
return result.data;
|
|
@@ -93,7 +99,7 @@ var RutterAccountingApi = class {
|
|
|
93
99
|
if (!result.success) {
|
|
94
100
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
95
101
|
endpoint,
|
|
96
|
-
|
|
102
|
+
z__default.default.prettifyError(result.error)
|
|
97
103
|
);
|
|
98
104
|
}
|
|
99
105
|
return result.data;
|
|
@@ -108,7 +114,7 @@ var RutterAccountingApi = class {
|
|
|
108
114
|
if (!result.success) {
|
|
109
115
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
110
116
|
endpoint,
|
|
111
|
-
|
|
117
|
+
z__default.default.prettifyError(result.error)
|
|
112
118
|
);
|
|
113
119
|
}
|
|
114
120
|
return result.data;
|
|
@@ -122,7 +128,7 @@ var RutterAccountingApi = class {
|
|
|
122
128
|
if (!result.success) {
|
|
123
129
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
124
130
|
endpoint,
|
|
125
|
-
|
|
131
|
+
z__default.default.prettifyError(result.error)
|
|
126
132
|
);
|
|
127
133
|
}
|
|
128
134
|
return result.data;
|
|
@@ -137,7 +143,7 @@ var RutterAccountingApi = class {
|
|
|
137
143
|
if (!result.success) {
|
|
138
144
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
139
145
|
endpoint,
|
|
140
|
-
|
|
146
|
+
z__default.default.prettifyError(result.error)
|
|
141
147
|
);
|
|
142
148
|
}
|
|
143
149
|
return result.data;
|
|
@@ -151,7 +157,7 @@ var RutterAccountingApi = class {
|
|
|
151
157
|
if (!result.success) {
|
|
152
158
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
153
159
|
endpoint,
|
|
154
|
-
|
|
160
|
+
z__default.default.prettifyError(result.error)
|
|
155
161
|
);
|
|
156
162
|
}
|
|
157
163
|
return result.data;
|
|
@@ -167,7 +173,7 @@ var RutterAccountingApi = class {
|
|
|
167
173
|
if (!result.success) {
|
|
168
174
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
169
175
|
endpoint,
|
|
170
|
-
|
|
176
|
+
z__default.default.prettifyError(result.error)
|
|
171
177
|
);
|
|
172
178
|
}
|
|
173
179
|
return result.data;
|
|
@@ -182,7 +188,7 @@ var RutterAccountingApi = class {
|
|
|
182
188
|
if (!result.success) {
|
|
183
189
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
184
190
|
endpoint,
|
|
185
|
-
|
|
191
|
+
z__default.default.prettifyError(result.error)
|
|
186
192
|
);
|
|
187
193
|
}
|
|
188
194
|
return result.data;
|
package/dist/api.d.cts
CHANGED
|
@@ -1,7 +1,147 @@
|
|
|
1
1
|
import z__default from 'zod';
|
|
2
2
|
import { b as RutterClient, c as RutterPaginationParams, d as RutterQueryParams } from './client-sPbSz2i_.cjs';
|
|
3
|
-
import { zConnectionResponse, zListConnectionsResponse,
|
|
3
|
+
import { zConnectionResponse, zListConnectionsResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse, CreateAccountingCustomer, zCreateAccountingCustomerResponse } from './generated.cjs';
|
|
4
4
|
|
|
5
|
+
declare const zGetAccessTokenConnectionResponse: z__default.ZodObject<{
|
|
6
|
+
connection: z__default.ZodObject<{
|
|
7
|
+
id: z__default.ZodString;
|
|
8
|
+
store_unique_id: z__default.ZodString;
|
|
9
|
+
estimated_completed_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
10
|
+
last_sync_completed_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
11
|
+
last_sync_started_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
12
|
+
oldest_order_date: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
13
|
+
newest_order_date: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
14
|
+
disabled: z__default.ZodBoolean;
|
|
15
|
+
link_url: z__default.ZodString;
|
|
16
|
+
needs_update: z__default.ZodBoolean;
|
|
17
|
+
platform: z__default.ZodEnum<{
|
|
18
|
+
AMAZON: "AMAZON";
|
|
19
|
+
EBAY: "EBAY";
|
|
20
|
+
ETSY: "ETSY";
|
|
21
|
+
FNAC: "FNAC";
|
|
22
|
+
WALMART: "WALMART";
|
|
23
|
+
SHOPEE: "SHOPEE";
|
|
24
|
+
LAZADA: "LAZADA";
|
|
25
|
+
MERCADOLIBRE: "MERCADOLIBRE";
|
|
26
|
+
ALIBABA: "ALIBABA";
|
|
27
|
+
SHOPLINE: "SHOPLINE";
|
|
28
|
+
PRESTASHOP: "PRESTASHOP";
|
|
29
|
+
SHOPIFY: "SHOPIFY";
|
|
30
|
+
MAGENTO: "MAGENTO";
|
|
31
|
+
WOO_COMMERCE: "WOO_COMMERCE";
|
|
32
|
+
SQUARESPACE: "SQUARESPACE";
|
|
33
|
+
WIX: "WIX";
|
|
34
|
+
SHOPER: "SHOPER";
|
|
35
|
+
SHOPLAZZA: "SHOPLAZZA";
|
|
36
|
+
BIG_COMMERCE: "BIG_COMMERCE";
|
|
37
|
+
SALLA: "SALLA";
|
|
38
|
+
ZID: "ZID";
|
|
39
|
+
COMMERCELAYER: "COMMERCELAYER";
|
|
40
|
+
WEBFLOW: "WEBFLOW";
|
|
41
|
+
GUMROAD: "GUMROAD";
|
|
42
|
+
ECWID: "ECWID";
|
|
43
|
+
PAYPAL: "PAYPAL";
|
|
44
|
+
SQUARE: "SQUARE";
|
|
45
|
+
STRIPE: "STRIPE";
|
|
46
|
+
CLOVER: "CLOVER";
|
|
47
|
+
MOLLIE: "MOLLIE";
|
|
48
|
+
PAYNL: "PAYNL";
|
|
49
|
+
AUTHORIZENET: "AUTHORIZENET";
|
|
50
|
+
RECHARGE: "RECHARGE";
|
|
51
|
+
CHARGIFY: "CHARGIFY";
|
|
52
|
+
CHARGEBEE: "CHARGEBEE";
|
|
53
|
+
RECURLY: "RECURLY";
|
|
54
|
+
KASHFLOW: "KASHFLOW";
|
|
55
|
+
SAGE_INTACCT: "SAGE_INTACCT";
|
|
56
|
+
SAGE_INTACCT_V2: "SAGE_INTACCT_V2";
|
|
57
|
+
DYNAMICS365: "DYNAMICS365";
|
|
58
|
+
ZOHOBOOKS: "ZOHOBOOKS";
|
|
59
|
+
EXACTONLINE: "EXACTONLINE";
|
|
60
|
+
FREEAGENT: "FREEAGENT";
|
|
61
|
+
QUICKBOOKS: "QUICKBOOKS";
|
|
62
|
+
QUICKBOOKS_DESKTOP: "QUICKBOOKS_DESKTOP";
|
|
63
|
+
FRESHBOOKS: "FRESHBOOKS";
|
|
64
|
+
XERO: "XERO";
|
|
65
|
+
SAGE_BUSINESS_CLOUD: "SAGE_BUSINESS_CLOUD";
|
|
66
|
+
SAGE_50: "SAGE_50";
|
|
67
|
+
NETSUITE: "NETSUITE";
|
|
68
|
+
WAVE: "WAVE";
|
|
69
|
+
DUALENTRY: "DUALENTRY";
|
|
70
|
+
MONEYBIRD: "MONEYBIRD";
|
|
71
|
+
SAGE200CLOUD: "SAGE200CLOUD";
|
|
72
|
+
MX: "MX";
|
|
73
|
+
PLAID: "PLAID";
|
|
74
|
+
TELLER: "TELLER";
|
|
75
|
+
ODOO: "ODOO";
|
|
76
|
+
TALLY: "TALLY";
|
|
77
|
+
GOOGLE: "GOOGLE";
|
|
78
|
+
FACEBOOK: "FACEBOOK";
|
|
79
|
+
TIKTOK: "TIKTOK";
|
|
80
|
+
INTUIT_BANK_FEEDS: "INTUIT_BANK_FEEDS";
|
|
81
|
+
SAGE: "SAGE";
|
|
82
|
+
SAGE_BANK_FEEDS: "SAGE_BANK_FEEDS";
|
|
83
|
+
QUICKBOOKS_HRIS: "QUICKBOOKS_HRIS";
|
|
84
|
+
BAMBOO_HR: "BAMBOO_HR";
|
|
85
|
+
GUSTO: "GUSTO";
|
|
86
|
+
}>;
|
|
87
|
+
store_domain: z__default.ZodNullable<z__default.ZodString>;
|
|
88
|
+
store_name: z__default.ZodNullable<z__default.ZodString>;
|
|
89
|
+
unavailable_objects: z__default.ZodNullable<z__default.ZodArray<z__default.ZodEnum<{
|
|
90
|
+
expense: "expense";
|
|
91
|
+
account: "account";
|
|
92
|
+
items: "items";
|
|
93
|
+
invoice_payment: "invoice_payment";
|
|
94
|
+
journal_entry: "journal_entry";
|
|
95
|
+
bank_deposit: "bank_deposit";
|
|
96
|
+
attachment: "attachment";
|
|
97
|
+
bank_feed_account: "bank_feed_account";
|
|
98
|
+
bank_feed_transaction: "bank_feed_transaction";
|
|
99
|
+
bank_transfer: "bank_transfer";
|
|
100
|
+
bill_credit_memo: "bill_credit_memo";
|
|
101
|
+
bill_payment: "bill_payment";
|
|
102
|
+
bill: "bill";
|
|
103
|
+
class: "class";
|
|
104
|
+
company_info: "company_info";
|
|
105
|
+
currencies: "currencies";
|
|
106
|
+
department: "department";
|
|
107
|
+
invoice_credit_memo: "invoice_credit_memo";
|
|
108
|
+
payment_method: "payment_method";
|
|
109
|
+
invoice: "invoice";
|
|
110
|
+
location: "location";
|
|
111
|
+
payment_term: "payment_term";
|
|
112
|
+
project: "project";
|
|
113
|
+
purchase_order: "purchase_order";
|
|
114
|
+
sales_order: "sales_order";
|
|
115
|
+
sales_receipt: "sales_receipt";
|
|
116
|
+
subsidiary: "subsidiary";
|
|
117
|
+
task: "task";
|
|
118
|
+
tax_agency: "tax_agency";
|
|
119
|
+
tax_area: "tax_area";
|
|
120
|
+
tax_rates: "tax_rates";
|
|
121
|
+
transaction: "transaction";
|
|
122
|
+
vendor: "vendor";
|
|
123
|
+
order: "order";
|
|
124
|
+
accounting_customer: "accounting_customer";
|
|
125
|
+
accounting_customer_refund: "accounting_customer_refund";
|
|
126
|
+
accounting_transaction: "accounting_transaction";
|
|
127
|
+
account_transaction: "account_transaction";
|
|
128
|
+
balance_sheet: "balance_sheet";
|
|
129
|
+
cash_flow: "cash_flow";
|
|
130
|
+
categories: "categories";
|
|
131
|
+
commerce_customer: "commerce_customer";
|
|
132
|
+
customer_group: "customer_group";
|
|
133
|
+
income_statement: "income_statement";
|
|
134
|
+
payout: "payout";
|
|
135
|
+
product: "product";
|
|
136
|
+
store: "store";
|
|
137
|
+
subscription: "subscription";
|
|
138
|
+
updated_transaction: "updated_transaction";
|
|
139
|
+
}>>>;
|
|
140
|
+
created_at: z__default.ZodOptional<z__default.ZodString>;
|
|
141
|
+
initial_orders_synced_count: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodNumber>>;
|
|
142
|
+
disabled_reason: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
143
|
+
}, z__default.core.$strip>;
|
|
144
|
+
}, z__default.core.$strip>;
|
|
5
145
|
type TConnectionResponse = z__default.infer<typeof zConnectionResponse>;
|
|
6
146
|
type TListConnectionsResponse = z__default.infer<typeof zListConnectionsResponse>;
|
|
7
147
|
type TExchangeTokenResponse = z__default.infer<typeof zExchangeTokenResponse>;
|
package/dist/api.d.ts
CHANGED
|
@@ -1,7 +1,147 @@
|
|
|
1
1
|
import z__default from 'zod';
|
|
2
2
|
import { b as RutterClient, c as RutterPaginationParams, d as RutterQueryParams } from './client-sPbSz2i_.js';
|
|
3
|
-
import { zConnectionResponse, zListConnectionsResponse,
|
|
3
|
+
import { zConnectionResponse, zListConnectionsResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse, CreateAccountingCustomer, zCreateAccountingCustomerResponse } from './generated.js';
|
|
4
4
|
|
|
5
|
+
declare const zGetAccessTokenConnectionResponse: z__default.ZodObject<{
|
|
6
|
+
connection: z__default.ZodObject<{
|
|
7
|
+
id: z__default.ZodString;
|
|
8
|
+
store_unique_id: z__default.ZodString;
|
|
9
|
+
estimated_completed_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
10
|
+
last_sync_completed_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
11
|
+
last_sync_started_at: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
12
|
+
oldest_order_date: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
13
|
+
newest_order_date: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
14
|
+
disabled: z__default.ZodBoolean;
|
|
15
|
+
link_url: z__default.ZodString;
|
|
16
|
+
needs_update: z__default.ZodBoolean;
|
|
17
|
+
platform: z__default.ZodEnum<{
|
|
18
|
+
AMAZON: "AMAZON";
|
|
19
|
+
EBAY: "EBAY";
|
|
20
|
+
ETSY: "ETSY";
|
|
21
|
+
FNAC: "FNAC";
|
|
22
|
+
WALMART: "WALMART";
|
|
23
|
+
SHOPEE: "SHOPEE";
|
|
24
|
+
LAZADA: "LAZADA";
|
|
25
|
+
MERCADOLIBRE: "MERCADOLIBRE";
|
|
26
|
+
ALIBABA: "ALIBABA";
|
|
27
|
+
SHOPLINE: "SHOPLINE";
|
|
28
|
+
PRESTASHOP: "PRESTASHOP";
|
|
29
|
+
SHOPIFY: "SHOPIFY";
|
|
30
|
+
MAGENTO: "MAGENTO";
|
|
31
|
+
WOO_COMMERCE: "WOO_COMMERCE";
|
|
32
|
+
SQUARESPACE: "SQUARESPACE";
|
|
33
|
+
WIX: "WIX";
|
|
34
|
+
SHOPER: "SHOPER";
|
|
35
|
+
SHOPLAZZA: "SHOPLAZZA";
|
|
36
|
+
BIG_COMMERCE: "BIG_COMMERCE";
|
|
37
|
+
SALLA: "SALLA";
|
|
38
|
+
ZID: "ZID";
|
|
39
|
+
COMMERCELAYER: "COMMERCELAYER";
|
|
40
|
+
WEBFLOW: "WEBFLOW";
|
|
41
|
+
GUMROAD: "GUMROAD";
|
|
42
|
+
ECWID: "ECWID";
|
|
43
|
+
PAYPAL: "PAYPAL";
|
|
44
|
+
SQUARE: "SQUARE";
|
|
45
|
+
STRIPE: "STRIPE";
|
|
46
|
+
CLOVER: "CLOVER";
|
|
47
|
+
MOLLIE: "MOLLIE";
|
|
48
|
+
PAYNL: "PAYNL";
|
|
49
|
+
AUTHORIZENET: "AUTHORIZENET";
|
|
50
|
+
RECHARGE: "RECHARGE";
|
|
51
|
+
CHARGIFY: "CHARGIFY";
|
|
52
|
+
CHARGEBEE: "CHARGEBEE";
|
|
53
|
+
RECURLY: "RECURLY";
|
|
54
|
+
KASHFLOW: "KASHFLOW";
|
|
55
|
+
SAGE_INTACCT: "SAGE_INTACCT";
|
|
56
|
+
SAGE_INTACCT_V2: "SAGE_INTACCT_V2";
|
|
57
|
+
DYNAMICS365: "DYNAMICS365";
|
|
58
|
+
ZOHOBOOKS: "ZOHOBOOKS";
|
|
59
|
+
EXACTONLINE: "EXACTONLINE";
|
|
60
|
+
FREEAGENT: "FREEAGENT";
|
|
61
|
+
QUICKBOOKS: "QUICKBOOKS";
|
|
62
|
+
QUICKBOOKS_DESKTOP: "QUICKBOOKS_DESKTOP";
|
|
63
|
+
FRESHBOOKS: "FRESHBOOKS";
|
|
64
|
+
XERO: "XERO";
|
|
65
|
+
SAGE_BUSINESS_CLOUD: "SAGE_BUSINESS_CLOUD";
|
|
66
|
+
SAGE_50: "SAGE_50";
|
|
67
|
+
NETSUITE: "NETSUITE";
|
|
68
|
+
WAVE: "WAVE";
|
|
69
|
+
DUALENTRY: "DUALENTRY";
|
|
70
|
+
MONEYBIRD: "MONEYBIRD";
|
|
71
|
+
SAGE200CLOUD: "SAGE200CLOUD";
|
|
72
|
+
MX: "MX";
|
|
73
|
+
PLAID: "PLAID";
|
|
74
|
+
TELLER: "TELLER";
|
|
75
|
+
ODOO: "ODOO";
|
|
76
|
+
TALLY: "TALLY";
|
|
77
|
+
GOOGLE: "GOOGLE";
|
|
78
|
+
FACEBOOK: "FACEBOOK";
|
|
79
|
+
TIKTOK: "TIKTOK";
|
|
80
|
+
INTUIT_BANK_FEEDS: "INTUIT_BANK_FEEDS";
|
|
81
|
+
SAGE: "SAGE";
|
|
82
|
+
SAGE_BANK_FEEDS: "SAGE_BANK_FEEDS";
|
|
83
|
+
QUICKBOOKS_HRIS: "QUICKBOOKS_HRIS";
|
|
84
|
+
BAMBOO_HR: "BAMBOO_HR";
|
|
85
|
+
GUSTO: "GUSTO";
|
|
86
|
+
}>;
|
|
87
|
+
store_domain: z__default.ZodNullable<z__default.ZodString>;
|
|
88
|
+
store_name: z__default.ZodNullable<z__default.ZodString>;
|
|
89
|
+
unavailable_objects: z__default.ZodNullable<z__default.ZodArray<z__default.ZodEnum<{
|
|
90
|
+
expense: "expense";
|
|
91
|
+
account: "account";
|
|
92
|
+
items: "items";
|
|
93
|
+
invoice_payment: "invoice_payment";
|
|
94
|
+
journal_entry: "journal_entry";
|
|
95
|
+
bank_deposit: "bank_deposit";
|
|
96
|
+
attachment: "attachment";
|
|
97
|
+
bank_feed_account: "bank_feed_account";
|
|
98
|
+
bank_feed_transaction: "bank_feed_transaction";
|
|
99
|
+
bank_transfer: "bank_transfer";
|
|
100
|
+
bill_credit_memo: "bill_credit_memo";
|
|
101
|
+
bill_payment: "bill_payment";
|
|
102
|
+
bill: "bill";
|
|
103
|
+
class: "class";
|
|
104
|
+
company_info: "company_info";
|
|
105
|
+
currencies: "currencies";
|
|
106
|
+
department: "department";
|
|
107
|
+
invoice_credit_memo: "invoice_credit_memo";
|
|
108
|
+
payment_method: "payment_method";
|
|
109
|
+
invoice: "invoice";
|
|
110
|
+
location: "location";
|
|
111
|
+
payment_term: "payment_term";
|
|
112
|
+
project: "project";
|
|
113
|
+
purchase_order: "purchase_order";
|
|
114
|
+
sales_order: "sales_order";
|
|
115
|
+
sales_receipt: "sales_receipt";
|
|
116
|
+
subsidiary: "subsidiary";
|
|
117
|
+
task: "task";
|
|
118
|
+
tax_agency: "tax_agency";
|
|
119
|
+
tax_area: "tax_area";
|
|
120
|
+
tax_rates: "tax_rates";
|
|
121
|
+
transaction: "transaction";
|
|
122
|
+
vendor: "vendor";
|
|
123
|
+
order: "order";
|
|
124
|
+
accounting_customer: "accounting_customer";
|
|
125
|
+
accounting_customer_refund: "accounting_customer_refund";
|
|
126
|
+
accounting_transaction: "accounting_transaction";
|
|
127
|
+
account_transaction: "account_transaction";
|
|
128
|
+
balance_sheet: "balance_sheet";
|
|
129
|
+
cash_flow: "cash_flow";
|
|
130
|
+
categories: "categories";
|
|
131
|
+
commerce_customer: "commerce_customer";
|
|
132
|
+
customer_group: "customer_group";
|
|
133
|
+
income_statement: "income_statement";
|
|
134
|
+
payout: "payout";
|
|
135
|
+
product: "product";
|
|
136
|
+
store: "store";
|
|
137
|
+
subscription: "subscription";
|
|
138
|
+
updated_transaction: "updated_transaction";
|
|
139
|
+
}>>>;
|
|
140
|
+
created_at: z__default.ZodOptional<z__default.ZodString>;
|
|
141
|
+
initial_orders_synced_count: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodNumber>>;
|
|
142
|
+
disabled_reason: z__default.ZodOptional<z__default.ZodNullable<z__default.ZodString>>;
|
|
143
|
+
}, z__default.core.$strip>;
|
|
144
|
+
}, z__default.core.$strip>;
|
|
5
145
|
type TConnectionResponse = z__default.infer<typeof zConnectionResponse>;
|
|
6
146
|
type TListConnectionsResponse = z__default.infer<typeof zListConnectionsResponse>;
|
|
7
147
|
type TExchangeTokenResponse = z__default.infer<typeof zExchangeTokenResponse>;
|
package/dist/api.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { RutterSchemaMismatchError } from './chunk-LLGYUOGX.js';
|
|
2
|
-
import { zConnectionResponse, zListConnectionsResponse,
|
|
3
|
-
import
|
|
2
|
+
import { zGetAccessTokenConnectionResponse, zConnectionResponse, zListConnectionsResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, zCreateInvoiceResponse, zCreateAccountingCustomerResponse } from './chunk-HSUL4OZU.js';
|
|
3
|
+
import z from 'zod';
|
|
4
4
|
|
|
5
|
+
var zGetAccessTokenConnectionResponse2 = zGetAccessTokenConnectionResponse.extend({
|
|
6
|
+
connection: zGetAccessTokenConnectionResponse.shape.connection.extend({
|
|
7
|
+
initial_orders_synced_count: z.number().nullish(),
|
|
8
|
+
disabled_reason: z.string().nullish()
|
|
9
|
+
})
|
|
10
|
+
});
|
|
5
11
|
var RutterConnectionsApi = class {
|
|
6
12
|
constructor(client) {
|
|
7
13
|
this.client = client;
|
|
@@ -16,7 +22,7 @@ var RutterConnectionsApi = class {
|
|
|
16
22
|
if (!result.success) {
|
|
17
23
|
throw new RutterSchemaMismatchError(
|
|
18
24
|
endpoint,
|
|
19
|
-
|
|
25
|
+
z.prettifyError(result.error)
|
|
20
26
|
);
|
|
21
27
|
}
|
|
22
28
|
return result.data;
|
|
@@ -28,21 +34,21 @@ var RutterConnectionsApi = class {
|
|
|
28
34
|
if (!result.success) {
|
|
29
35
|
throw new RutterSchemaMismatchError(
|
|
30
36
|
endpoint,
|
|
31
|
-
|
|
37
|
+
z.prettifyError(result.error)
|
|
32
38
|
);
|
|
33
39
|
}
|
|
34
40
|
return result.data;
|
|
35
41
|
}
|
|
36
42
|
async get(accessToken) {
|
|
37
|
-
const endpoint = "/connections";
|
|
43
|
+
const endpoint = "/connections/access_token";
|
|
38
44
|
const response = await this.client.get(endpoint, {
|
|
39
45
|
access_token: accessToken
|
|
40
46
|
});
|
|
41
|
-
const result =
|
|
47
|
+
const result = zGetAccessTokenConnectionResponse2.safeParse(response);
|
|
42
48
|
if (!result.success) {
|
|
43
49
|
throw new RutterSchemaMismatchError(
|
|
44
50
|
endpoint,
|
|
45
|
-
|
|
51
|
+
z.prettifyError(result.error)
|
|
46
52
|
);
|
|
47
53
|
}
|
|
48
54
|
return result.data;
|
|
@@ -54,7 +60,7 @@ var RutterConnectionsApi = class {
|
|
|
54
60
|
if (!result.success) {
|
|
55
61
|
throw new RutterSchemaMismatchError(
|
|
56
62
|
endpoint,
|
|
57
|
-
|
|
63
|
+
z.prettifyError(result.error)
|
|
58
64
|
);
|
|
59
65
|
}
|
|
60
66
|
return result.data;
|
|
@@ -68,7 +74,7 @@ var RutterConnectionsApi = class {
|
|
|
68
74
|
if (!result.success) {
|
|
69
75
|
throw new RutterSchemaMismatchError(
|
|
70
76
|
endpoint,
|
|
71
|
-
|
|
77
|
+
z.prettifyError(result.error)
|
|
72
78
|
);
|
|
73
79
|
}
|
|
74
80
|
return result.data;
|
|
@@ -87,7 +93,7 @@ var RutterAccountingApi = class {
|
|
|
87
93
|
if (!result.success) {
|
|
88
94
|
throw new RutterSchemaMismatchError(
|
|
89
95
|
endpoint,
|
|
90
|
-
|
|
96
|
+
z.prettifyError(result.error)
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
99
|
return result.data;
|
|
@@ -102,7 +108,7 @@ var RutterAccountingApi = class {
|
|
|
102
108
|
if (!result.success) {
|
|
103
109
|
throw new RutterSchemaMismatchError(
|
|
104
110
|
endpoint,
|
|
105
|
-
|
|
111
|
+
z.prettifyError(result.error)
|
|
106
112
|
);
|
|
107
113
|
}
|
|
108
114
|
return result.data;
|
|
@@ -116,7 +122,7 @@ var RutterAccountingApi = class {
|
|
|
116
122
|
if (!result.success) {
|
|
117
123
|
throw new RutterSchemaMismatchError(
|
|
118
124
|
endpoint,
|
|
119
|
-
|
|
125
|
+
z.prettifyError(result.error)
|
|
120
126
|
);
|
|
121
127
|
}
|
|
122
128
|
return result.data;
|
|
@@ -131,7 +137,7 @@ var RutterAccountingApi = class {
|
|
|
131
137
|
if (!result.success) {
|
|
132
138
|
throw new RutterSchemaMismatchError(
|
|
133
139
|
endpoint,
|
|
134
|
-
|
|
140
|
+
z.prettifyError(result.error)
|
|
135
141
|
);
|
|
136
142
|
}
|
|
137
143
|
return result.data;
|
|
@@ -145,7 +151,7 @@ var RutterAccountingApi = class {
|
|
|
145
151
|
if (!result.success) {
|
|
146
152
|
throw new RutterSchemaMismatchError(
|
|
147
153
|
endpoint,
|
|
148
|
-
|
|
154
|
+
z.prettifyError(result.error)
|
|
149
155
|
);
|
|
150
156
|
}
|
|
151
157
|
return result.data;
|
|
@@ -161,7 +167,7 @@ var RutterAccountingApi = class {
|
|
|
161
167
|
if (!result.success) {
|
|
162
168
|
throw new RutterSchemaMismatchError(
|
|
163
169
|
endpoint,
|
|
164
|
-
|
|
170
|
+
z.prettifyError(result.error)
|
|
165
171
|
);
|
|
166
172
|
}
|
|
167
173
|
return result.data;
|
|
@@ -176,7 +182,7 @@ var RutterAccountingApi = class {
|
|
|
176
182
|
if (!result.success) {
|
|
177
183
|
throw new RutterSchemaMismatchError(
|
|
178
184
|
endpoint,
|
|
179
|
-
|
|
185
|
+
z.prettifyError(result.error)
|
|
180
186
|
);
|
|
181
187
|
}
|
|
182
188
|
return result.data;
|