rutter-ts 0.2.0 → 0.3.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/dist/api.cjs +15 -0
- package/dist/api.d.cts +3 -1
- package/dist/api.d.ts +3 -1
- package/dist/api.js +16 -1
- package/package.json +1 -1
package/dist/api.cjs
CHANGED
|
@@ -169,6 +169,21 @@ var RutterAccountingApi = class {
|
|
|
169
169
|
}
|
|
170
170
|
return result.data;
|
|
171
171
|
}
|
|
172
|
+
async createCustomer(accessToken, params) {
|
|
173
|
+
const endpoint = "/accounting/customers";
|
|
174
|
+
const response = await this.client.post(
|
|
175
|
+
`${endpoint}?access_token=${encodeURIComponent(accessToken)}`,
|
|
176
|
+
{ customer: params }
|
|
177
|
+
);
|
|
178
|
+
const result = chunkJCJXW7AE_cjs.zCreateAccountingCustomerResponse.safeParse(response);
|
|
179
|
+
if (!result.success) {
|
|
180
|
+
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
181
|
+
endpoint,
|
|
182
|
+
z2__default.default.prettifyError(result.error)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return result.data;
|
|
186
|
+
}
|
|
172
187
|
};
|
|
173
188
|
|
|
174
189
|
exports.RutterAccountingApi = RutterAccountingApi;
|
package/dist/api.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse } from './generated.cjs';
|
|
3
|
+
import { zConnectionResponse, zListConnectionsResponse, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse, CreateAccountingCustomer, zCreateAccountingCustomerResponse } from './generated.cjs';
|
|
4
4
|
|
|
5
5
|
type TConnectionResponse = z__default.infer<typeof zConnectionResponse>;
|
|
6
6
|
type TListConnectionsResponse = z__default.infer<typeof zListConnectionsResponse>;
|
|
@@ -27,6 +27,7 @@ type TAccountResponse = z__default.infer<typeof zAccountResponseWithConnection>;
|
|
|
27
27
|
type TListInvoicesResponse = z__default.infer<typeof zListInvoiceResponseWithConnection>;
|
|
28
28
|
type TInvoiceResponse = z__default.infer<typeof zInvoiceResponseWithConnection>;
|
|
29
29
|
type TCreateInvoiceResponse = z__default.infer<typeof zCreateInvoiceResponse>;
|
|
30
|
+
type TCreateCustomerResponse = z__default.infer<typeof zCreateAccountingCustomerResponse>;
|
|
30
31
|
declare class RutterAccountingApi {
|
|
31
32
|
private readonly client;
|
|
32
33
|
constructor(client: RutterClient);
|
|
@@ -36,6 +37,7 @@ declare class RutterAccountingApi {
|
|
|
36
37
|
listInvoices(accessToken: string, params?: RutterPaginationParams & RutterQueryParams): Promise<TListInvoicesResponse>;
|
|
37
38
|
getInvoice(accessToken: string, id: string): Promise<TInvoiceResponse>;
|
|
38
39
|
createInvoice(accessToken: string, params: CreateInvoice, idempotencyKey?: string): Promise<TCreateInvoiceResponse>;
|
|
40
|
+
createCustomer(accessToken: string, params: CreateAccountingCustomer): Promise<TCreateCustomerResponse>;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export { RutterAccountingApi, RutterConnectionsApi };
|
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse } from './generated.js';
|
|
3
|
+
import { zConnectionResponse, zListConnectionsResponse, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, CreateInvoice, zCreateInvoiceResponse, CreateAccountingCustomer, zCreateAccountingCustomerResponse } from './generated.js';
|
|
4
4
|
|
|
5
5
|
type TConnectionResponse = z__default.infer<typeof zConnectionResponse>;
|
|
6
6
|
type TListConnectionsResponse = z__default.infer<typeof zListConnectionsResponse>;
|
|
@@ -27,6 +27,7 @@ type TAccountResponse = z__default.infer<typeof zAccountResponseWithConnection>;
|
|
|
27
27
|
type TListInvoicesResponse = z__default.infer<typeof zListInvoiceResponseWithConnection>;
|
|
28
28
|
type TInvoiceResponse = z__default.infer<typeof zInvoiceResponseWithConnection>;
|
|
29
29
|
type TCreateInvoiceResponse = z__default.infer<typeof zCreateInvoiceResponse>;
|
|
30
|
+
type TCreateCustomerResponse = z__default.infer<typeof zCreateAccountingCustomerResponse>;
|
|
30
31
|
declare class RutterAccountingApi {
|
|
31
32
|
private readonly client;
|
|
32
33
|
constructor(client: RutterClient);
|
|
@@ -36,6 +37,7 @@ declare class RutterAccountingApi {
|
|
|
36
37
|
listInvoices(accessToken: string, params?: RutterPaginationParams & RutterQueryParams): Promise<TListInvoicesResponse>;
|
|
37
38
|
getInvoice(accessToken: string, id: string): Promise<TInvoiceResponse>;
|
|
38
39
|
createInvoice(accessToken: string, params: CreateInvoice, idempotencyKey?: string): Promise<TCreateInvoiceResponse>;
|
|
40
|
+
createCustomer(accessToken: string, params: CreateAccountingCustomer): Promise<TCreateCustomerResponse>;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export { RutterAccountingApi, RutterConnectionsApi };
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RutterSchemaMismatchError } from './chunk-LLGYUOGX.js';
|
|
2
|
-
import { zConnectionResponse, zListConnectionsResponse, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, zCreateInvoiceResponse } from './chunk-HSUL4OZU.js';
|
|
2
|
+
import { zConnectionResponse, zListConnectionsResponse, zGetAccessTokenConnectionResponse, zExchangeTokenResponse, zDeleteConnectionResponse, zCompanyInfo20240430ResponseWithConnection, zListAccountResponseWithConnection, zAccountResponseWithConnection, zListInvoiceResponseWithConnection, zInvoiceResponseWithConnection, zCreateInvoiceResponse, zCreateAccountingCustomerResponse } from './chunk-HSUL4OZU.js';
|
|
3
3
|
import z2 from 'zod';
|
|
4
4
|
|
|
5
5
|
var RutterConnectionsApi = class {
|
|
@@ -163,6 +163,21 @@ var RutterAccountingApi = class {
|
|
|
163
163
|
}
|
|
164
164
|
return result.data;
|
|
165
165
|
}
|
|
166
|
+
async createCustomer(accessToken, params) {
|
|
167
|
+
const endpoint = "/accounting/customers";
|
|
168
|
+
const response = await this.client.post(
|
|
169
|
+
`${endpoint}?access_token=${encodeURIComponent(accessToken)}`,
|
|
170
|
+
{ customer: params }
|
|
171
|
+
);
|
|
172
|
+
const result = zCreateAccountingCustomerResponse.safeParse(response);
|
|
173
|
+
if (!result.success) {
|
|
174
|
+
throw new RutterSchemaMismatchError(
|
|
175
|
+
endpoint,
|
|
176
|
+
z2.prettifyError(result.error)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return result.data;
|
|
180
|
+
}
|
|
166
181
|
};
|
|
167
182
|
|
|
168
183
|
export { RutterAccountingApi, RutterConnectionsApi };
|