@genz-its/sevdesk-sdk 0.0.0 → 0.1.1
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/README.md +1 -1
- package/dist/index.d.ts +148 -5
- package/dist/index.js +181 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,6 @@ try {
|
|
|
109
109
|
|
|
110
110
|
## License
|
|
111
111
|
|
|
112
|
-
[
|
|
112
|
+
See [LICENSE](https://github.com/genz-its/sevdesk/blob/main/LICENSE).
|
|
113
113
|
|
|
114
114
|
[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by sevDesk GmbH or any of their affiliates or subsidiaries.
|
package/dist/index.d.ts
CHANGED
|
@@ -146,6 +146,133 @@ declare class CheckAccountsResource extends BaseResource {
|
|
|
146
146
|
}): Promise<string>;
|
|
147
147
|
}
|
|
148
148
|
//#endregion
|
|
149
|
+
//#region src/resources/communication-ways.d.ts
|
|
150
|
+
/** The medium of a communication way. */
|
|
151
|
+
type CommunicationWayType = 'EMAIL' | 'PHONE' | 'WEB' | 'MOBILE';
|
|
152
|
+
interface ListCommunicationWaysOptions extends ListOptions {
|
|
153
|
+
/** Only returns the communication ways of this contact. */
|
|
154
|
+
contactId?: number;
|
|
155
|
+
type?: CommunicationWayType;
|
|
156
|
+
/** `'1'` returns only the main communication ways. */
|
|
157
|
+
main?: '0' | '1';
|
|
158
|
+
}
|
|
159
|
+
interface CreateCommunicationWayOptions {
|
|
160
|
+
/** The contact this communication way belongs to. */
|
|
161
|
+
contactId: number;
|
|
162
|
+
type: CommunicationWayType;
|
|
163
|
+
/** The phone number, e-mail address or website. */
|
|
164
|
+
value: string;
|
|
165
|
+
/**
|
|
166
|
+
* The key of the communication way, e.g. `1` for private and `2` for work.
|
|
167
|
+
* For all keys, send a `GET` to `/CommunicationWayKey`.
|
|
168
|
+
*/
|
|
169
|
+
keyId: number;
|
|
170
|
+
/** Defines if this is the main communication way of the contact. */
|
|
171
|
+
main?: boolean;
|
|
172
|
+
}
|
|
173
|
+
interface UpdateCommunicationWayOptions extends Partial<CreateCommunicationWayOptions> {
|
|
174
|
+
communicationWayId: number;
|
|
175
|
+
}
|
|
176
|
+
interface CommunicationWay {
|
|
177
|
+
id: string;
|
|
178
|
+
objectName: string;
|
|
179
|
+
create: string;
|
|
180
|
+
update: string;
|
|
181
|
+
sevClient: ModelRefResponse;
|
|
182
|
+
contact: ModelRefResponse;
|
|
183
|
+
type: string;
|
|
184
|
+
value: string;
|
|
185
|
+
key: ModelRefResponse;
|
|
186
|
+
main: string;
|
|
187
|
+
}
|
|
188
|
+
/** The key of a communication way, similar to the category of an address. */
|
|
189
|
+
interface CommunicationWayKey {
|
|
190
|
+
id: string;
|
|
191
|
+
objectName: string;
|
|
192
|
+
create: string;
|
|
193
|
+
update: string;
|
|
194
|
+
name: string;
|
|
195
|
+
translationCode: string;
|
|
196
|
+
}
|
|
197
|
+
declare class CommunicationWaysResource extends BaseResource {
|
|
198
|
+
/** Retrieves communication ways via `GET /CommunicationWay`. */
|
|
199
|
+
list(options?: ListCommunicationWaysOptions): Promise<CommunicationWay[]>;
|
|
200
|
+
/** Retrieves a single communication way via `GET /CommunicationWay/{communicationWayId}`. */
|
|
201
|
+
get(options: {
|
|
202
|
+
communicationWayId: number;
|
|
203
|
+
}): Promise<CommunicationWay>;
|
|
204
|
+
/** Creates a communication way via `POST /CommunicationWay`. */
|
|
205
|
+
create(options: CreateCommunicationWayOptions): Promise<CommunicationWay>;
|
|
206
|
+
/** Updates a communication way via `PUT /CommunicationWay/{communicationWayId}`. */
|
|
207
|
+
update(options: UpdateCommunicationWayOptions): Promise<CommunicationWay>;
|
|
208
|
+
/** Deletes a communication way via `DELETE /CommunicationWay/{communicationWayId}`. */
|
|
209
|
+
delete(options: {
|
|
210
|
+
communicationWayId: number;
|
|
211
|
+
}): Promise<void>;
|
|
212
|
+
/** Retrieves all communication way keys via `GET /CommunicationWayKey`. */
|
|
213
|
+
listKeys(options?: ListOptions): Promise<CommunicationWayKey[]>;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/resources/contact-addresses.d.ts
|
|
217
|
+
interface CreateContactAddressOptions {
|
|
218
|
+
/** The contact this address belongs to. */
|
|
219
|
+
contactId: number;
|
|
220
|
+
/** The country of the address. For all countries, send a `GET` to `/StaticCountry`. */
|
|
221
|
+
countryId: number;
|
|
222
|
+
/**
|
|
223
|
+
* The category of the address. For all categories, send a `GET` to
|
|
224
|
+
* `/Category?objectType=ContactAddress`.
|
|
225
|
+
*/
|
|
226
|
+
categoryId: number;
|
|
227
|
+
street?: string;
|
|
228
|
+
zip?: string;
|
|
229
|
+
city?: string;
|
|
230
|
+
/** Name in the address. */
|
|
231
|
+
name?: string;
|
|
232
|
+
/** Second name in the address. */
|
|
233
|
+
name2?: string;
|
|
234
|
+
/** Third name in the address. */
|
|
235
|
+
name3?: string;
|
|
236
|
+
/** Fourth name in the address. */
|
|
237
|
+
name4?: string;
|
|
238
|
+
}
|
|
239
|
+
interface UpdateContactAddressOptions extends Partial<CreateContactAddressOptions> {
|
|
240
|
+
contactAddressId: number;
|
|
241
|
+
}
|
|
242
|
+
interface ContactAddress {
|
|
243
|
+
id: string;
|
|
244
|
+
objectName: string;
|
|
245
|
+
create: string;
|
|
246
|
+
update: string;
|
|
247
|
+
sevClient: ModelRefResponse;
|
|
248
|
+
contact: ModelRefResponse;
|
|
249
|
+
street: string | null;
|
|
250
|
+
zip: string | null;
|
|
251
|
+
city: string | null;
|
|
252
|
+
country: ModelRefResponse;
|
|
253
|
+
category: ModelRefResponse | null;
|
|
254
|
+
name: string | null;
|
|
255
|
+
name2: string | null;
|
|
256
|
+
name3: string | null;
|
|
257
|
+
name4: string | null;
|
|
258
|
+
}
|
|
259
|
+
declare class ContactAddressesResource extends BaseResource {
|
|
260
|
+
/** Retrieves contact addresses via `GET /ContactAddress`. */
|
|
261
|
+
list(options?: ListOptions): Promise<ContactAddress[]>;
|
|
262
|
+
/** Retrieves a single contact address via `GET /ContactAddress/{contactAddressId}`. */
|
|
263
|
+
get(options: {
|
|
264
|
+
contactAddressId: number;
|
|
265
|
+
}): Promise<ContactAddress>;
|
|
266
|
+
/** Creates a contact address via `POST /ContactAddress`. */
|
|
267
|
+
create(options: CreateContactAddressOptions): Promise<ContactAddress>;
|
|
268
|
+
/** Updates a contact address via `PUT /ContactAddress/{contactAddressId}`. */
|
|
269
|
+
update(options: UpdateContactAddressOptions): Promise<ContactAddress>;
|
|
270
|
+
/** Deletes a contact address via `DELETE /ContactAddress/{contactAddressId}`. */
|
|
271
|
+
delete(options: {
|
|
272
|
+
contactAddressId: number;
|
|
273
|
+
}): Promise<void>;
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
149
276
|
//#region src/resources/contacts.d.ts
|
|
150
277
|
/** `100` for a lead, `500` for a pending and `1000` for an active contact. */
|
|
151
278
|
type ContactStatus = 100 | 500 | 1000;
|
|
@@ -540,6 +667,7 @@ declare class CreditNotesResource extends BaseResource {
|
|
|
540
667
|
/** Retrieves a single credit note via `GET /CreditNote/{creditNoteId}`. */
|
|
541
668
|
get(options: {
|
|
542
669
|
creditNoteId: number;
|
|
670
|
+
embed?: string[];
|
|
543
671
|
}): Promise<CreditNote>;
|
|
544
672
|
/** Creates or updates a credit note with its positions via `POST /CreditNote/Factory/saveCreditNote`. */
|
|
545
673
|
save(options: SaveCreditNoteOptions): Promise<SaveCreditNoteResult>;
|
|
@@ -1063,6 +1191,7 @@ declare class InvoicesResource extends BaseResource {
|
|
|
1063
1191
|
/** Retrieves a single invoice via `GET /Invoice/{invoiceId}`. */
|
|
1064
1192
|
get(options: {
|
|
1065
1193
|
invoiceId: number;
|
|
1194
|
+
embed?: string[];
|
|
1066
1195
|
}): Promise<Invoice>;
|
|
1067
1196
|
/**
|
|
1068
1197
|
* Creates or updates an invoice with its positions via
|
|
@@ -1413,6 +1542,7 @@ declare class OrdersResource extends BaseResource {
|
|
|
1413
1542
|
/** Retrieves a single order via `GET /Order/{orderId}`. */
|
|
1414
1543
|
get(options: {
|
|
1415
1544
|
orderId: number;
|
|
1545
|
+
embed?: string[];
|
|
1416
1546
|
}): Promise<Order>;
|
|
1417
1547
|
/** Creates or updates an order with its positions via `POST /Order/Factory/saveOrder`. */
|
|
1418
1548
|
save(options: SaveOrderOptions): Promise<SaveOrderResult>;
|
|
@@ -1814,6 +1944,18 @@ interface ListVouchersOptions extends ListOptions {
|
|
|
1814
1944
|
startDate?: DateInput;
|
|
1815
1945
|
endDate?: DateInput;
|
|
1816
1946
|
contactId?: number;
|
|
1947
|
+
/**
|
|
1948
|
+
* Filters vouchers by a linked object, for example a document the voucher
|
|
1949
|
+
* originated from. Payment bookings are not exposed as linked objects, so
|
|
1950
|
+
* this cannot look up the voucher booked against a bank transaction.
|
|
1951
|
+
*/
|
|
1952
|
+
linkedObjectId?: number;
|
|
1953
|
+
linkedObjectName?: string;
|
|
1954
|
+
embed?: string[];
|
|
1955
|
+
}
|
|
1956
|
+
interface ListVoucherPositionsOptions extends ListOptions {
|
|
1957
|
+
/** Only returns the positions of this voucher. */
|
|
1958
|
+
voucherId?: number;
|
|
1817
1959
|
embed?: string[];
|
|
1818
1960
|
}
|
|
1819
1961
|
interface UpdateVoucherOptions {
|
|
@@ -1919,6 +2061,7 @@ declare class VouchersResource extends BaseResource {
|
|
|
1919
2061
|
/** Retrieves a single voucher via `GET /Voucher/{voucherId}`. */
|
|
1920
2062
|
get(options: {
|
|
1921
2063
|
voucherId: number;
|
|
2064
|
+
embed?: string[];
|
|
1922
2065
|
}): Promise<Voucher>;
|
|
1923
2066
|
/** Uploads a voucher document via `POST /Voucher/Factory/uploadTempFile`. */
|
|
1924
2067
|
uploadFile(options: {
|
|
@@ -1950,16 +2093,16 @@ declare class VouchersResource extends BaseResource {
|
|
|
1950
2093
|
enshrine(options: {
|
|
1951
2094
|
voucherId: number;
|
|
1952
2095
|
}): Promise<void>;
|
|
1953
|
-
/** Retrieves
|
|
1954
|
-
listPositions(options:
|
|
1955
|
-
voucherId: number;
|
|
1956
|
-
} & ListOptions): Promise<VoucherPosition[]>;
|
|
2096
|
+
/** Retrieves voucher positions via `GET /VoucherPos`. */
|
|
2097
|
+
listPositions(options?: ListVoucherPositionsOptions): Promise<VoucherPosition[]>;
|
|
1957
2098
|
}
|
|
1958
2099
|
//#endregion
|
|
1959
2100
|
//#region src/client.d.ts
|
|
1960
2101
|
declare class SevDesk {
|
|
1961
2102
|
readonly basics: BasicsResource;
|
|
1962
2103
|
readonly checkAccounts: CheckAccountsResource;
|
|
2104
|
+
readonly communicationWays: CommunicationWaysResource;
|
|
2105
|
+
readonly contactAddresses: ContactAddressesResource;
|
|
1963
2106
|
readonly contacts: ContactsResource;
|
|
1964
2107
|
readonly creditNotes: CreditNotesResource;
|
|
1965
2108
|
readonly exports: ExportsResource;
|
|
@@ -1986,5 +2129,5 @@ declare class SevDeskError extends Error {
|
|
|
1986
2129
|
});
|
|
1987
2130
|
}
|
|
1988
2131
|
//#endregion
|
|
1989
|
-
export { AllowedTaxRule, BasicsResource, BookCreditNoteOptions, BookCreditNoteResult, BookInvoiceOptions, BookInvoiceResult, BookVoucherOptions, BookVoucherResult, BookkeepingSystemVersion, CheckAccount, CheckAccountTransaction, CheckAccountsResource, Contact, ContactStatus, ContactTabsItemCount, ContactsResource, CreateClearingAccountOptions, CreateContactOptions, CreateCreditNoteFromInvoiceResult, CreateFileImportAccountOptions, CreateInvoiceFromOrderOptions, CreatePartOptions, CreateTagOptions, CreateTransactionOptions, CreditNote, CreditNoteBookingCategory, CreditNoteBookingType, CreditNoteDiscount, CreditNoteInput, CreditNoteMail, CreditNotePdf, CreditNotePosition, CreditNotePositionInput, CreditNoteSendType, CreditNoteStatus, CreditNotesResource, DEFAULT_BASE_URL, type DateInput, ExportConfigOptions, ExportContactFilter, ExportContactsOptions, ExportCreditNotesOptions, ExportDatevCsvJobOptions, ExportDatevXmlJobOptions, ExportDocumentFilter, ExportFile, ExportInvoiceFilter, ExportInvoiceType, ExportInvoicesOptions, ExportJobDownloadInfo, ExportProgress, ExportSevQueryObject, ExportSevQueryOptions, ExportSevQueryValue, ExportTransactionFilter, ExportTransactionsOptions, ExportVoucherFilter, ExportVouchersOptions, ExportsResource, FindContactsByCustomFieldValueOptions, GetOrderRelatedObjectsOptions, type HttpRequestOptions, Invoice, InvoiceBookingType, InvoiceEmail, InvoiceInput, InvoicePdf, InvoicePosition, InvoicePositionInput, InvoiceRenderParameter, InvoiceSendType, InvoiceStatus, InvoiceType, InvoicesResource, ListContactsOptions, ListCreditNotePositionsOptions, ListCreditNotesOptions, ListInvoicesOptions, type ListOptions, ListOrderPositionsOptions, ListOrdersOptions, ListPartsOptions, ListTagsOptions, ListTransactionsOptions, ListVouchersOptions, type ModelRef, type ModelRefResponse, Order, OrderDiscount, OrderInput, OrderMail, OrderPdf, OrderPosition, OrderPositionInput, OrderRelatedObject, OrderSendType, OrderStatus, OrderType, OrdersResource, Part, PartStatus, PartsResource, type Query, type QueryValue, ReceiptGuidanceResource, ReceiptGuide, RenderInvoiceResult, ReportContactListOptions, ReportInvoiceListOptions, ReportOrderFilter, ReportOrderListOptions, ReportOrderType, ReportVoucherListOptions, ReportsResource, SaveCreditNoteOptions, SaveCreditNoteResult, SaveInvoiceOptions, SaveInvoiceResult, SaveOrderOptions, SaveOrderResult, SaveVoucherOptions, SaveVoucherResult, SendCreditNoteByOptions, SendCreditNoteViaEmailOptions, SendInvoiceByOptions, SendInvoiceViaEmailOptions, SendOrderByOptions, SendOrderViaEmailOptions, SevDesk, SevDeskError, type SevDeskOptions, Tag, TagObjectType, TagRelation, TagsResource, TransactionStatus, TransactionsResource, UpdateCheckAccountOptions, UpdateContactOptions, UpdateCreditNoteOptions, UpdateOrderOptions, UpdateOrderPositionOptions, UpdatePartOptions, UpdateTransactionOptions, UpdateVoucherOptions, UploadVoucherFileResult, Voucher, VoucherBookingType, VoucherInput, VoucherPosition, VoucherPositionInput, VoucherStatus, VouchersResource, toExportContactFilter, toExportDocumentFilter, toExportInvoiceFilter, toExportSevQueryParams, toExportVoucherFilter };
|
|
2132
|
+
export { AllowedTaxRule, BasicsResource, BookCreditNoteOptions, BookCreditNoteResult, BookInvoiceOptions, BookInvoiceResult, BookVoucherOptions, BookVoucherResult, BookkeepingSystemVersion, CheckAccount, CheckAccountTransaction, CheckAccountsResource, CommunicationWay, CommunicationWayKey, CommunicationWayType, CommunicationWaysResource, Contact, ContactAddress, ContactAddressesResource, ContactStatus, ContactTabsItemCount, ContactsResource, CreateClearingAccountOptions, CreateCommunicationWayOptions, CreateContactAddressOptions, CreateContactOptions, CreateCreditNoteFromInvoiceResult, CreateFileImportAccountOptions, CreateInvoiceFromOrderOptions, CreatePartOptions, CreateTagOptions, CreateTransactionOptions, CreditNote, CreditNoteBookingCategory, CreditNoteBookingType, CreditNoteDiscount, CreditNoteInput, CreditNoteMail, CreditNotePdf, CreditNotePosition, CreditNotePositionInput, CreditNoteSendType, CreditNoteStatus, CreditNotesResource, DEFAULT_BASE_URL, type DateInput, ExportConfigOptions, ExportContactFilter, ExportContactsOptions, ExportCreditNotesOptions, ExportDatevCsvJobOptions, ExportDatevXmlJobOptions, ExportDocumentFilter, ExportFile, ExportInvoiceFilter, ExportInvoiceType, ExportInvoicesOptions, ExportJobDownloadInfo, ExportProgress, ExportSevQueryObject, ExportSevQueryOptions, ExportSevQueryValue, ExportTransactionFilter, ExportTransactionsOptions, ExportVoucherFilter, ExportVouchersOptions, ExportsResource, FindContactsByCustomFieldValueOptions, GetOrderRelatedObjectsOptions, type HttpRequestOptions, Invoice, InvoiceBookingType, InvoiceEmail, InvoiceInput, InvoicePdf, InvoicePosition, InvoicePositionInput, InvoiceRenderParameter, InvoiceSendType, InvoiceStatus, InvoiceType, InvoicesResource, ListCommunicationWaysOptions, ListContactsOptions, ListCreditNotePositionsOptions, ListCreditNotesOptions, ListInvoicesOptions, type ListOptions, ListOrderPositionsOptions, ListOrdersOptions, ListPartsOptions, ListTagsOptions, ListTransactionsOptions, ListVoucherPositionsOptions, ListVouchersOptions, type ModelRef, type ModelRefResponse, Order, OrderDiscount, OrderInput, OrderMail, OrderPdf, OrderPosition, OrderPositionInput, OrderRelatedObject, OrderSendType, OrderStatus, OrderType, OrdersResource, Part, PartStatus, PartsResource, type Query, type QueryValue, ReceiptGuidanceResource, ReceiptGuide, RenderInvoiceResult, ReportContactListOptions, ReportInvoiceListOptions, ReportOrderFilter, ReportOrderListOptions, ReportOrderType, ReportVoucherListOptions, ReportsResource, SaveCreditNoteOptions, SaveCreditNoteResult, SaveInvoiceOptions, SaveInvoiceResult, SaveOrderOptions, SaveOrderResult, SaveVoucherOptions, SaveVoucherResult, SendCreditNoteByOptions, SendCreditNoteViaEmailOptions, SendInvoiceByOptions, SendInvoiceViaEmailOptions, SendOrderByOptions, SendOrderViaEmailOptions, SevDesk, SevDeskError, type SevDeskOptions, Tag, TagObjectType, TagRelation, TagsResource, TransactionStatus, TransactionsResource, UpdateCheckAccountOptions, UpdateCommunicationWayOptions, UpdateContactAddressOptions, UpdateContactOptions, UpdateCreditNoteOptions, UpdateOrderOptions, UpdateOrderPositionOptions, UpdatePartOptions, UpdateTransactionOptions, UpdateVoucherOptions, UploadVoucherFileResult, Voucher, VoucherBookingType, VoucherInput, VoucherPosition, VoucherPositionInput, VoucherStatus, VouchersResource, toExportContactFilter, toExportDocumentFilter, toExportInvoiceFilter, toExportSevQueryParams, toExportVoucherFilter };
|
|
1990
2133
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -266,6 +266,165 @@ var CheckAccountsResource = class extends BaseResource {
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
//#endregion
|
|
269
|
+
//#region src/resources/communication-ways.ts
|
|
270
|
+
var CommunicationWaysResource = class extends BaseResource {
|
|
271
|
+
/** Retrieves communication ways via `GET /CommunicationWay`. */
|
|
272
|
+
list(options = {}) {
|
|
273
|
+
const { contactId, type, main, limit, offset } = options;
|
|
274
|
+
return this.http.request({
|
|
275
|
+
method: "GET",
|
|
276
|
+
path: "/CommunicationWay",
|
|
277
|
+
query: {
|
|
278
|
+
"contact[id]": contactId,
|
|
279
|
+
"contact[objectName]": contactId === void 0 ? void 0 : "Contact",
|
|
280
|
+
type,
|
|
281
|
+
main,
|
|
282
|
+
limit,
|
|
283
|
+
offset
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
/** Retrieves a single communication way via `GET /CommunicationWay/{communicationWayId}`. */
|
|
288
|
+
async get(options) {
|
|
289
|
+
const communicationWay = (await this.http.request({
|
|
290
|
+
method: "GET",
|
|
291
|
+
path: `/CommunicationWay/${options.communicationWayId}`
|
|
292
|
+
}))[0];
|
|
293
|
+
if (!communicationWay) throw new SevDeskError({
|
|
294
|
+
status: 404,
|
|
295
|
+
statusText: "Not Found",
|
|
296
|
+
body: null
|
|
297
|
+
});
|
|
298
|
+
return communicationWay;
|
|
299
|
+
}
|
|
300
|
+
/** Creates a communication way via `POST /CommunicationWay`. */
|
|
301
|
+
create(options) {
|
|
302
|
+
return this.http.request({
|
|
303
|
+
method: "POST",
|
|
304
|
+
path: "/CommunicationWay",
|
|
305
|
+
body: toCommunicationWayBody(options)
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/** Updates a communication way via `PUT /CommunicationWay/{communicationWayId}`. */
|
|
309
|
+
update(options) {
|
|
310
|
+
const { communicationWayId, ...fields } = options;
|
|
311
|
+
return this.http.request({
|
|
312
|
+
method: "PUT",
|
|
313
|
+
path: `/CommunicationWay/${communicationWayId}`,
|
|
314
|
+
body: toCommunicationWayBody(fields)
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** Deletes a communication way via `DELETE /CommunicationWay/{communicationWayId}`. */
|
|
318
|
+
async delete(options) {
|
|
319
|
+
await this.http.request({
|
|
320
|
+
method: "DELETE",
|
|
321
|
+
path: `/CommunicationWay/${options.communicationWayId}`
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/** Retrieves all communication way keys via `GET /CommunicationWayKey`. */
|
|
325
|
+
listKeys(options = {}) {
|
|
326
|
+
return this.http.request({
|
|
327
|
+
method: "GET",
|
|
328
|
+
path: "/CommunicationWayKey",
|
|
329
|
+
query: {
|
|
330
|
+
limit: options.limit,
|
|
331
|
+
offset: options.offset
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
function toCommunicationWayBody(fields) {
|
|
337
|
+
return {
|
|
338
|
+
objectName: "CommunicationWay",
|
|
339
|
+
mapAll: true,
|
|
340
|
+
contact: toRef$8(fields.contactId, "Contact"),
|
|
341
|
+
type: fields.type,
|
|
342
|
+
value: fields.value,
|
|
343
|
+
key: toRef$8(fields.keyId, "CommunicationWayKey"),
|
|
344
|
+
main: fields.main
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function toRef$8(id, objectName) {
|
|
348
|
+
return id === void 0 ? void 0 : {
|
|
349
|
+
id,
|
|
350
|
+
objectName
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/resources/contact-addresses.ts
|
|
355
|
+
var ContactAddressesResource = class extends BaseResource {
|
|
356
|
+
/** Retrieves contact addresses via `GET /ContactAddress`. */
|
|
357
|
+
list(options = {}) {
|
|
358
|
+
return this.http.request({
|
|
359
|
+
method: "GET",
|
|
360
|
+
path: "/ContactAddress",
|
|
361
|
+
query: {
|
|
362
|
+
limit: options.limit,
|
|
363
|
+
offset: options.offset
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/** Retrieves a single contact address via `GET /ContactAddress/{contactAddressId}`. */
|
|
368
|
+
async get(options) {
|
|
369
|
+
const address = (await this.http.request({
|
|
370
|
+
method: "GET",
|
|
371
|
+
path: `/ContactAddress/${options.contactAddressId}`
|
|
372
|
+
}))[0];
|
|
373
|
+
if (!address) throw new SevDeskError({
|
|
374
|
+
status: 404,
|
|
375
|
+
statusText: "Not Found",
|
|
376
|
+
body: null
|
|
377
|
+
});
|
|
378
|
+
return address;
|
|
379
|
+
}
|
|
380
|
+
/** Creates a contact address via `POST /ContactAddress`. */
|
|
381
|
+
create(options) {
|
|
382
|
+
return this.http.request({
|
|
383
|
+
method: "POST",
|
|
384
|
+
path: "/ContactAddress",
|
|
385
|
+
body: toContactAddressBody(options)
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/** Updates a contact address via `PUT /ContactAddress/{contactAddressId}`. */
|
|
389
|
+
update(options) {
|
|
390
|
+
const { contactAddressId, ...fields } = options;
|
|
391
|
+
return this.http.request({
|
|
392
|
+
method: "PUT",
|
|
393
|
+
path: `/ContactAddress/${contactAddressId}`,
|
|
394
|
+
body: toContactAddressBody(fields)
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
/** Deletes a contact address via `DELETE /ContactAddress/{contactAddressId}`. */
|
|
398
|
+
async delete(options) {
|
|
399
|
+
await this.http.request({
|
|
400
|
+
method: "DELETE",
|
|
401
|
+
path: `/ContactAddress/${options.contactAddressId}`
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
function toContactAddressBody(fields) {
|
|
406
|
+
return {
|
|
407
|
+
objectName: "ContactAddress",
|
|
408
|
+
mapAll: true,
|
|
409
|
+
contact: toRef$7(fields.contactId, "Contact"),
|
|
410
|
+
country: toRef$7(fields.countryId, "StaticCountry"),
|
|
411
|
+
category: toRef$7(fields.categoryId, "Category"),
|
|
412
|
+
street: fields.street,
|
|
413
|
+
zip: fields.zip,
|
|
414
|
+
city: fields.city,
|
|
415
|
+
name: fields.name,
|
|
416
|
+
name2: fields.name2,
|
|
417
|
+
name3: fields.name3,
|
|
418
|
+
name4: fields.name4
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function toRef$7(id, objectName) {
|
|
422
|
+
return id === void 0 ? void 0 : {
|
|
423
|
+
id,
|
|
424
|
+
objectName
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
//#endregion
|
|
269
428
|
//#region src/resources/contacts.ts
|
|
270
429
|
var ContactsResource = class extends BaseResource {
|
|
271
430
|
/** Retrieves contacts via `GET /Contact`. */
|
|
@@ -420,7 +579,8 @@ var CreditNotesResource = class extends BaseResource {
|
|
|
420
579
|
async get(options) {
|
|
421
580
|
const creditNote = (await this.http.request({
|
|
422
581
|
method: "GET",
|
|
423
|
-
path: `/CreditNote/${options.creditNoteId}
|
|
582
|
+
path: `/CreditNote/${options.creditNoteId}`,
|
|
583
|
+
query: { embed: options.embed }
|
|
424
584
|
}))[0];
|
|
425
585
|
if (!creditNote) throw new SevDeskError({
|
|
426
586
|
status: 404,
|
|
@@ -874,7 +1034,8 @@ var InvoicesResource = class extends BaseResource {
|
|
|
874
1034
|
async get(options) {
|
|
875
1035
|
const invoice = (await this.http.request({
|
|
876
1036
|
method: "GET",
|
|
877
|
-
path: `/Invoice/${options.invoiceId}
|
|
1037
|
+
path: `/Invoice/${options.invoiceId}`,
|
|
1038
|
+
query: { embed: options.embed }
|
|
878
1039
|
}))[0];
|
|
879
1040
|
if (!invoice) throw new SevDeskError({
|
|
880
1041
|
status: 404,
|
|
@@ -1166,7 +1327,8 @@ var OrdersResource = class extends BaseResource {
|
|
|
1166
1327
|
async get(options) {
|
|
1167
1328
|
const order = (await this.http.request({
|
|
1168
1329
|
method: "GET",
|
|
1169
|
-
path: `/Order/${options.orderId}
|
|
1330
|
+
path: `/Order/${options.orderId}`,
|
|
1331
|
+
query: { embed: options.embed }
|
|
1170
1332
|
}))[0];
|
|
1171
1333
|
if (!order) throw new SevDeskError({
|
|
1172
1334
|
status: 404,
|
|
@@ -1785,7 +1947,7 @@ function toOptionalIsoDateTime(value) {
|
|
|
1785
1947
|
var VouchersResource = class extends BaseResource {
|
|
1786
1948
|
/** Retrieves vouchers via `GET /Voucher`. */
|
|
1787
1949
|
list(options = {}) {
|
|
1788
|
-
const { status, creditDebit, descriptionLike, startDate, endDate, contactId, limit, offset, embed } = options;
|
|
1950
|
+
const { status, creditDebit, descriptionLike, startDate, endDate, contactId, linkedObjectId, linkedObjectName, limit, offset, embed } = options;
|
|
1789
1951
|
return this.http.request({
|
|
1790
1952
|
method: "GET",
|
|
1791
1953
|
path: "/Voucher",
|
|
@@ -1797,6 +1959,8 @@ var VouchersResource = class extends BaseResource {
|
|
|
1797
1959
|
endDate: toOptionalVoucherDate(endDate),
|
|
1798
1960
|
"contact[id]": contactId,
|
|
1799
1961
|
"contact[objectName]": contactId === void 0 ? void 0 : "Contact",
|
|
1962
|
+
"object[id]": linkedObjectId,
|
|
1963
|
+
"object[objectName]": linkedObjectId === void 0 ? void 0 : linkedObjectName,
|
|
1800
1964
|
limit,
|
|
1801
1965
|
offset,
|
|
1802
1966
|
embed
|
|
@@ -1807,7 +1971,8 @@ var VouchersResource = class extends BaseResource {
|
|
|
1807
1971
|
async get(options) {
|
|
1808
1972
|
const voucher = (await this.http.request({
|
|
1809
1973
|
method: "GET",
|
|
1810
|
-
path: `/Voucher/${options.voucherId}
|
|
1974
|
+
path: `/Voucher/${options.voucherId}`,
|
|
1975
|
+
query: { embed: options.embed }
|
|
1811
1976
|
}))[0];
|
|
1812
1977
|
if (!voucher) throw new SevDeskError({
|
|
1813
1978
|
status: 404,
|
|
@@ -1914,17 +2079,18 @@ var VouchersResource = class extends BaseResource {
|
|
|
1914
2079
|
path: `/Voucher/${options.voucherId}/enshrine`
|
|
1915
2080
|
});
|
|
1916
2081
|
}
|
|
1917
|
-
/** Retrieves
|
|
1918
|
-
listPositions(options) {
|
|
1919
|
-
const { voucherId, limit, offset } = options;
|
|
2082
|
+
/** Retrieves voucher positions via `GET /VoucherPos`. */
|
|
2083
|
+
listPositions(options = {}) {
|
|
2084
|
+
const { voucherId, limit, offset, embed } = options;
|
|
1920
2085
|
return this.http.request({
|
|
1921
2086
|
method: "GET",
|
|
1922
2087
|
path: "/VoucherPos",
|
|
1923
2088
|
query: {
|
|
1924
2089
|
"voucher[id]": voucherId,
|
|
1925
|
-
"voucher[objectName]": "Voucher",
|
|
2090
|
+
"voucher[objectName]": voucherId === void 0 ? void 0 : "Voucher",
|
|
1926
2091
|
limit,
|
|
1927
|
-
offset
|
|
2092
|
+
offset,
|
|
2093
|
+
embed
|
|
1928
2094
|
}
|
|
1929
2095
|
});
|
|
1930
2096
|
}
|
|
@@ -1983,6 +2149,8 @@ function toOptionalVoucherDate(value) {
|
|
|
1983
2149
|
var SevDesk = class {
|
|
1984
2150
|
basics;
|
|
1985
2151
|
checkAccounts;
|
|
2152
|
+
communicationWays;
|
|
2153
|
+
contactAddresses;
|
|
1986
2154
|
contacts;
|
|
1987
2155
|
creditNotes;
|
|
1988
2156
|
exports;
|
|
@@ -1998,6 +2166,8 @@ var SevDesk = class {
|
|
|
1998
2166
|
const http = new HttpClient(options);
|
|
1999
2167
|
this.basics = new BasicsResource(http);
|
|
2000
2168
|
this.checkAccounts = new CheckAccountsResource(http);
|
|
2169
|
+
this.communicationWays = new CommunicationWaysResource(http);
|
|
2170
|
+
this.contactAddresses = new ContactAddressesResource(http);
|
|
2001
2171
|
this.contacts = new ContactsResource(http);
|
|
2002
2172
|
this.creditNotes = new CreditNotesResource(http);
|
|
2003
2173
|
this.exports = new ExportsResource(http);
|
|
@@ -2012,6 +2182,6 @@ var SevDesk = class {
|
|
|
2012
2182
|
}
|
|
2013
2183
|
};
|
|
2014
2184
|
//#endregion
|
|
2015
|
-
export { BasicsResource, CheckAccountsResource, ContactsResource, CreditNotesResource, DEFAULT_BASE_URL, ExportsResource, InvoicesResource, OrdersResource, PartsResource, ReceiptGuidanceResource, ReportsResource, SevDesk, SevDeskError, TagsResource, TransactionsResource, VouchersResource, toExportContactFilter, toExportDocumentFilter, toExportInvoiceFilter, toExportSevQueryParams, toExportVoucherFilter };
|
|
2185
|
+
export { BasicsResource, CheckAccountsResource, CommunicationWaysResource, ContactAddressesResource, ContactsResource, CreditNotesResource, DEFAULT_BASE_URL, ExportsResource, InvoicesResource, OrdersResource, PartsResource, ReceiptGuidanceResource, ReportsResource, SevDesk, SevDeskError, TagsResource, TransactionsResource, VouchersResource, toExportContactFilter, toExportDocumentFilter, toExportInvoiceFilter, toExportSevQueryParams, toExportVoucherFilter };
|
|
2016
2186
|
|
|
2017
2187
|
//# sourceMappingURL=index.js.map
|