nordlet 0.1.2 → 0.2.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.
Files changed (140) hide show
  1. package/README.md +60 -0
  2. package/dist/api/resources/account/client/requests/PostV1AccountCompaniesCreateRequest.d.ts +1 -0
  3. package/dist/api/resources/account/client/requests/PostV1AccountCompaniesUpdateRequest.d.ts +1 -0
  4. package/dist/api/resources/account/types/PostV1AccountCompaniesProfileResponse.d.ts +1 -0
  5. package/dist/api/resources/account/types/PostV1AccountCompaniesUpdateResponse.d.ts +1 -0
  6. package/dist/api/resources/agreements/client/Client.d.ts +38 -0
  7. package/dist/api/resources/agreements/client/Client.js +146 -0
  8. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsBillingRunRequest.d.ts +7 -0
  9. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsBillingRunRequest.js +3 -0
  10. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsCreateRequest.d.ts +8 -0
  11. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsCreateRequest.js +5 -0
  12. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsGenerateInvoiceRequest.d.ts +10 -0
  13. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsGenerateInvoiceRequest.js +3 -0
  14. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsUpdateRequest.d.ts +7 -0
  15. package/dist/api/resources/agreements/client/requests/PostV1AgreementsAgreementsUpdateRequest.js +5 -0
  16. package/dist/api/resources/agreements/client/requests/index.d.ts +2 -0
  17. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsBillingRunResponse.d.ts +23 -0
  18. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsBillingRunResponse.js +3 -0
  19. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsCreateResponse.d.ts +8 -0
  20. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsCreateResponse.js +5 -0
  21. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsGenerateInvoiceResponse.d.ts +6 -0
  22. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsGenerateInvoiceResponse.js +3 -0
  23. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsGetResponse.d.ts +8 -0
  24. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsGetResponse.js +5 -0
  25. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsListResponse.d.ts +7 -0
  26. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsListResponse.js +5 -0
  27. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsUpdateResponse.d.ts +8 -0
  28. package/dist/api/resources/agreements/types/PostV1AgreementsAgreementsUpdateResponse.js +5 -0
  29. package/dist/api/resources/agreements/types/index.d.ts +2 -0
  30. package/dist/api/resources/agreements/types/index.js +2 -0
  31. package/dist/api/resources/declarations/client/Client.d.ts +133 -0
  32. package/dist/api/resources/declarations/client/Client.js +511 -0
  33. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuDistanceSalesThresholdGetRequest.d.ts +7 -0
  34. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuDistanceSalesThresholdGetRequest.js +3 -0
  35. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeCrossBorderReportComputeRequest.d.ts +11 -0
  36. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeCrossBorderReportComputeRequest.js +3 -0
  37. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeThresholdGetRequest.d.ts +7 -0
  38. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeThresholdGetRequest.js +3 -0
  39. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeThresholdsListRequest.d.ts +5 -0
  40. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuSmeThresholdsListRequest.js +3 -0
  41. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuUnionTurnoverGetRequest.d.ts +7 -0
  42. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuUnionTurnoverGetRequest.js +3 -0
  43. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuVatReturnComputeRequest.d.ts +14 -0
  44. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuVatReturnComputeRequest.js +3 -0
  45. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuVatReturnPacksListRequest.d.ts +5 -0
  46. package/dist/api/resources/declarations/client/requests/PostV1DeclarationsEuVatReturnPacksListRequest.js +3 -0
  47. package/dist/api/resources/declarations/client/requests/index.d.ts +7 -0
  48. package/dist/api/resources/declarations/types/PostV1DeclarationsEuDistanceSalesThresholdGetResponse.d.ts +21 -0
  49. package/dist/api/resources/declarations/types/PostV1DeclarationsEuDistanceSalesThresholdGetResponse.js +3 -0
  50. package/dist/api/resources/declarations/types/PostV1DeclarationsEuIossComputeResponse.d.ts +18 -0
  51. package/dist/api/resources/declarations/types/PostV1DeclarationsEuOssComputeResponse.d.ts +18 -0
  52. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeCrossBorderReportComputeResponse.d.ts +20 -0
  53. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeCrossBorderReportComputeResponse.js +3 -0
  54. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeThresholdGetResponse.d.ts +67 -0
  55. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeThresholdGetResponse.js +22 -0
  56. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeThresholdsListResponse.d.ts +34 -0
  57. package/dist/api/resources/declarations/types/PostV1DeclarationsEuSmeThresholdsListResponse.js +3 -0
  58. package/dist/api/resources/declarations/types/PostV1DeclarationsEuUnionTurnoverGetResponse.d.ts +29 -0
  59. package/dist/api/resources/declarations/types/PostV1DeclarationsEuUnionTurnoverGetResponse.js +13 -0
  60. package/dist/api/resources/declarations/types/PostV1DeclarationsEuVatReturnComputeResponse.d.ts +28 -0
  61. package/dist/api/resources/declarations/types/PostV1DeclarationsEuVatReturnComputeResponse.js +12 -0
  62. package/dist/api/resources/declarations/types/PostV1DeclarationsEuVatReturnPacksListResponse.d.ts +23 -0
  63. package/dist/api/resources/declarations/types/PostV1DeclarationsEuVatReturnPacksListResponse.js +18 -0
  64. package/dist/api/resources/declarations/types/index.d.ts +7 -0
  65. package/dist/api/resources/declarations/types/index.js +7 -0
  66. package/dist/api/resources/ledger/client/requests/PostV1LedgerPostingRulesUpdateRequest.d.ts +3 -0
  67. package/dist/api/resources/ledger/client/requests/PostV1LedgerPostingRulesUpdateRequest.js +3 -0
  68. package/dist/api/resources/reference/client/Client.d.ts +28 -0
  69. package/dist/api/resources/reference/client/Client.js +82 -0
  70. package/dist/api/resources/reference/client/requests/PostV1ReferenceEuVatRatesSetOverridesRequest.d.ts +32 -0
  71. package/dist/api/resources/reference/client/requests/PostV1ReferenceEuVatRatesSetOverridesRequest.js +19 -0
  72. package/dist/api/resources/reference/client/requests/index.d.ts +1 -0
  73. package/dist/api/resources/reference/client/requests/index.js +3 -1
  74. package/dist/api/resources/reference/types/PostV1ReferenceEuVatRatesListResponse.d.ts +7 -0
  75. package/dist/api/resources/reference/types/PostV1ReferenceEuVatRatesListResponse.js +4 -0
  76. package/dist/api/resources/reference/types/PostV1ReferenceEuVatRatesSetOverridesResponse.d.ts +29 -0
  77. package/dist/api/resources/reference/types/PostV1ReferenceEuVatRatesSetOverridesResponse.js +23 -0
  78. package/dist/api/resources/reference/types/PostV1ReferenceVatResolveResponse.d.ts +1 -0
  79. package/dist/api/resources/reference/types/PostV1ReferenceVatResolveResponse.js +1 -0
  80. package/dist/api/resources/reference/types/index.d.ts +1 -0
  81. package/dist/api/resources/reference/types/index.js +1 -0
  82. package/dist/api/resources/sales/client/Client.d.ts +173 -0
  83. package/dist/api/resources/sales/client/Client.js +659 -0
  84. package/dist/api/resources/sales/client/requests/PostV1SalesInvoicesCreateRequest.d.ts +27 -0
  85. package/dist/api/resources/sales/client/requests/PostV1SalesInvoicesCreateRequest.js +16 -0
  86. package/dist/api/resources/sales/client/requests/PostV1SalesInvoicesUpdateRequest.d.ts +27 -0
  87. package/dist/api/resources/sales/client/requests/PostV1SalesInvoicesUpdateRequest.js +16 -0
  88. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionComputeRequest.d.ts +7 -0
  89. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionComputeRequest.js +3 -0
  90. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionModifyRequest.d.ts +29 -0
  91. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionModifyRequest.js +11 -0
  92. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionProgressRequest.d.ts +12 -0
  93. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionProgressRequest.js +3 -0
  94. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionRunRequest.d.ts +9 -0
  95. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionRunRequest.js +3 -0
  96. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionRunsListRequest.d.ts +46 -0
  97. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionRunsListRequest.js +31 -0
  98. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionSchedulesListRequest.d.ts +46 -0
  99. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionSchedulesListRequest.js +31 -0
  100. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionSummaryRequest.d.ts +7 -0
  101. package/dist/api/resources/sales/client/requests/PostV1SalesRecognitionSummaryRequest.js +3 -0
  102. package/dist/api/resources/sales/client/requests/PostV1SalesRefundLiabilityListRequest.d.ts +46 -0
  103. package/dist/api/resources/sales/client/requests/PostV1SalesRefundLiabilityListRequest.js +31 -0
  104. package/dist/api/resources/sales/client/requests/PostV1SalesRefundLiabilityTrueUpRequest.d.ts +12 -0
  105. package/dist/api/resources/sales/client/requests/PostV1SalesRefundLiabilityTrueUpRequest.js +3 -0
  106. package/dist/api/resources/sales/client/requests/index.d.ts +9 -0
  107. package/dist/api/resources/sales/client/requests/index.js +9 -1
  108. package/dist/api/resources/sales/types/PostV1SalesInvoicesApplyAdvanceResponse.d.ts +26 -0
  109. package/dist/api/resources/sales/types/PostV1SalesInvoicesApplyAdvanceResponse.js +13 -0
  110. package/dist/api/resources/sales/types/PostV1SalesInvoicesCreateResponse.d.ts +26 -0
  111. package/dist/api/resources/sales/types/PostV1SalesInvoicesCreateResponse.js +13 -0
  112. package/dist/api/resources/sales/types/PostV1SalesInvoicesGetResponse.d.ts +26 -0
  113. package/dist/api/resources/sales/types/PostV1SalesInvoicesGetResponse.js +13 -0
  114. package/dist/api/resources/sales/types/PostV1SalesInvoicesIssueResponse.d.ts +26 -0
  115. package/dist/api/resources/sales/types/PostV1SalesInvoicesIssueResponse.js +13 -0
  116. package/dist/api/resources/sales/types/PostV1SalesInvoicesListResponse.d.ts +2 -0
  117. package/dist/api/resources/sales/types/PostV1SalesInvoicesListResponse.js +1 -0
  118. package/dist/api/resources/sales/types/PostV1SalesInvoicesUpdateResponse.d.ts +26 -0
  119. package/dist/api/resources/sales/types/PostV1SalesInvoicesUpdateResponse.js +13 -0
  120. package/dist/api/resources/sales/types/PostV1SalesRecognitionComputeResponse.d.ts +20 -0
  121. package/dist/api/resources/sales/types/PostV1SalesRecognitionComputeResponse.js +3 -0
  122. package/dist/api/resources/sales/types/PostV1SalesRecognitionModifyResponse.d.ts +16 -0
  123. package/dist/api/resources/sales/types/PostV1SalesRecognitionModifyResponse.js +11 -0
  124. package/dist/api/resources/sales/types/PostV1SalesRecognitionProgressResponse.d.ts +7 -0
  125. package/dist/api/resources/sales/types/PostV1SalesRecognitionProgressResponse.js +3 -0
  126. package/dist/api/resources/sales/types/PostV1SalesRecognitionRunResponse.d.ts +19 -0
  127. package/dist/api/resources/sales/types/PostV1SalesRecognitionRunResponse.js +15 -0
  128. package/dist/api/resources/sales/types/PostV1SalesRecognitionRunsListResponse.d.ts +31 -0
  129. package/dist/api/resources/sales/types/PostV1SalesRecognitionRunsListResponse.js +21 -0
  130. package/dist/api/resources/sales/types/PostV1SalesRecognitionSchedulesListResponse.d.ts +40 -0
  131. package/dist/api/resources/sales/types/PostV1SalesRecognitionSchedulesListResponse.js +24 -0
  132. package/dist/api/resources/sales/types/PostV1SalesRecognitionSummaryResponse.d.ts +35 -0
  133. package/dist/api/resources/sales/types/PostV1SalesRecognitionSummaryResponse.js +19 -0
  134. package/dist/api/resources/sales/types/PostV1SalesRefundLiabilityListResponse.d.ts +22 -0
  135. package/dist/api/resources/sales/types/PostV1SalesRefundLiabilityListResponse.js +3 -0
  136. package/dist/api/resources/sales/types/PostV1SalesRefundLiabilityTrueUpResponse.d.ts +8 -0
  137. package/dist/api/resources/sales/types/PostV1SalesRefundLiabilityTrueUpResponse.js +3 -0
  138. package/dist/api/resources/sales/types/index.d.ts +9 -0
  139. package/dist/api/resources/sales/types/index.js +9 -0
  140. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Nordlet TypeScript Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Nordlet%2FTypeScript)
4
+ [![npm shield](https://img.shields.io/npm/v/nordlet)](https://www.npmjs.com/package/nordlet)
5
+
6
+ The Nordlet TypeScript library provides convenient access to the Nordlet Accounting API from TypeScript and JavaScript (Node.js ≥ 18, browsers, and edge runtimes — anywhere `fetch` is available).
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ npm install nordlet
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Instantiate the client with your API key and call any endpoint:
17
+
18
+ ```ts
19
+ import { NordletApiClient } from "nordlet";
20
+
21
+ const client = new NordletApiClient({ token: "nl_..." });
22
+
23
+ const invoice = await client.sales.postV1SalesInvoicesCreate({
24
+ partnerId: "partner-id",
25
+ lines: [{ description: "Consulting", quantity: 4, unitPriceExclVat: "75.0000" }],
26
+ });
27
+ ```
28
+
29
+ Every operation is `POST /v1/{module}/{resource}/{action}`; monetary amounts are decimal strings, never floats.
30
+
31
+ ## Environments and custom base URL
32
+
33
+ The client defaults to production (`https://api.nordlet.com`). Point it elsewhere with `environment` or `baseUrl`:
34
+
35
+ ```ts
36
+ import { NordletApiClient } from "nordlet";
37
+
38
+ const client = new NordletApiClient({
39
+ token: "nl_...",
40
+ baseUrl: "http://localhost:3001",
41
+ });
42
+ ```
43
+
44
+ ## Retries and timeouts
45
+
46
+ Requests are retried twice by default with exponential backoff. Configure per client or per request:
47
+
48
+ ```ts
49
+ const client = new NordletApiClient({ token: "nl_...", maxRetries: 0, timeoutInSeconds: 30 });
50
+
51
+ await client.sales.postV1SalesInvoicesList({}, { maxRetries: 5, timeoutInSeconds: 60 });
52
+ ```
53
+
54
+ ## Documentation
55
+
56
+ The full API reference lives at [docs.nordlet.com](https://docs.nordlet.com) — every endpoint, request/response schema, error envelope, idempotency and webhook conventions.
57
+
58
+ ## Contributing
59
+
60
+ This SDK is generated from the Nordlet OpenAPI specification; releases are cut automatically and any manual change here would be overwritten. Open issues and suggestions on the [GitHub repository](https://github.com/nordlet/nordlet-sdk-typescript).
@@ -8,6 +8,7 @@ export interface PostV1AccountCompaniesCreateRequest {
8
8
  name: string;
9
9
  code?: string;
10
10
  vatCode?: string;
11
+ smeExemptionNumber?: string;
11
12
  isVatPayer?: boolean;
12
13
  address?: PostV1AccountCompaniesCreateRequest.Address;
13
14
  email?: string;
@@ -6,6 +6,7 @@ export interface PostV1AccountCompaniesUpdateRequest {
6
6
  name?: string;
7
7
  code?: string;
8
8
  vatCode?: string;
9
+ smeExemptionNumber?: string;
9
10
  isVatPayer?: boolean;
10
11
  address?: PostV1AccountCompaniesUpdateRequest.Address;
11
12
  email?: string;
@@ -3,6 +3,7 @@ export interface PostV1AccountCompaniesProfileResponse {
3
3
  name: string;
4
4
  code: string | null;
5
5
  vatCode: string | null;
6
+ smeExemptionNumber: string | null;
6
7
  isVatPayer: boolean;
7
8
  isSandbox: boolean;
8
9
  countryCode: string;
@@ -3,6 +3,7 @@ export interface PostV1AccountCompaniesUpdateResponse {
3
3
  name: string;
4
4
  code: string | null;
5
5
  vatCode: string | null;
6
+ smeExemptionNumber: string | null;
6
7
  isVatPayer: boolean;
7
8
  isSandbox: boolean;
8
9
  countryCode: string;
@@ -149,6 +149,44 @@ export declare class AgreementsClient {
149
149
  */
150
150
  postV1AgreementsAgreementsList(request?: NordletApi.PostV1AgreementsAgreementsListRequest, requestOptions?: AgreementsClient.RequestOptions): core.HttpResponsePromise<NordletApi.PostV1AgreementsAgreementsListResponse>;
151
151
  private __postV1AgreementsAgreementsList;
152
+ /**
153
+ * @param {NordletApi.PostV1AgreementsAgreementsGenerateInvoiceRequest} request
154
+ * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
155
+ *
156
+ * @throws {@link NordletApi.BadRequestError}
157
+ * @throws {@link NordletApi.UnauthorizedError}
158
+ * @throws {@link NordletApi.ForbiddenError}
159
+ * @throws {@link NordletApi.NotFoundError}
160
+ * @throws {@link NordletApi.ConflictError}
161
+ * @throws {@link NordletApi.UnprocessableEntityError}
162
+ * @throws {@link NordletApi.TooManyRequestsError}
163
+ * @throws {@link NordletApi.InternalServerError}
164
+ *
165
+ * @example
166
+ * await client.agreements.postV1AgreementsAgreementsGenerateInvoice({
167
+ * id: "id"
168
+ * })
169
+ */
170
+ postV1AgreementsAgreementsGenerateInvoice(request: NordletApi.PostV1AgreementsAgreementsGenerateInvoiceRequest, requestOptions?: AgreementsClient.RequestOptions): core.HttpResponsePromise<NordletApi.PostV1AgreementsAgreementsGenerateInvoiceResponse>;
171
+ private __postV1AgreementsAgreementsGenerateInvoice;
172
+ /**
173
+ * @param {NordletApi.PostV1AgreementsAgreementsBillingRunRequest} request
174
+ * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
175
+ *
176
+ * @throws {@link NordletApi.BadRequestError}
177
+ * @throws {@link NordletApi.UnauthorizedError}
178
+ * @throws {@link NordletApi.ForbiddenError}
179
+ * @throws {@link NordletApi.NotFoundError}
180
+ * @throws {@link NordletApi.ConflictError}
181
+ * @throws {@link NordletApi.UnprocessableEntityError}
182
+ * @throws {@link NordletApi.TooManyRequestsError}
183
+ * @throws {@link NordletApi.InternalServerError}
184
+ *
185
+ * @example
186
+ * await client.agreements.postV1AgreementsAgreementsBillingRun()
187
+ */
188
+ postV1AgreementsAgreementsBillingRun(request?: NordletApi.PostV1AgreementsAgreementsBillingRunRequest, requestOptions?: AgreementsClient.RequestOptions): core.HttpResponsePromise<NordletApi.PostV1AgreementsAgreementsBillingRunResponse>;
189
+ private __postV1AgreementsAgreementsBillingRun;
152
190
  /**
153
191
  * @param {NordletApi.PostV1AgreementsInsurancePoliciesCreateRequest} request
154
192
  * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -564,6 +564,152 @@ class AgreementsClient {
564
564
  }
565
565
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/agreements/agreements/list");
566
566
  }
567
+ /**
568
+ * @param {NordletApi.PostV1AgreementsAgreementsGenerateInvoiceRequest} request
569
+ * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
570
+ *
571
+ * @throws {@link NordletApi.BadRequestError}
572
+ * @throws {@link NordletApi.UnauthorizedError}
573
+ * @throws {@link NordletApi.ForbiddenError}
574
+ * @throws {@link NordletApi.NotFoundError}
575
+ * @throws {@link NordletApi.ConflictError}
576
+ * @throws {@link NordletApi.UnprocessableEntityError}
577
+ * @throws {@link NordletApi.TooManyRequestsError}
578
+ * @throws {@link NordletApi.InternalServerError}
579
+ *
580
+ * @example
581
+ * await client.agreements.postV1AgreementsAgreementsGenerateInvoice({
582
+ * id: "id"
583
+ * })
584
+ */
585
+ postV1AgreementsAgreementsGenerateInvoice(request, requestOptions) {
586
+ return core.HttpResponsePromise.fromPromise(this.__postV1AgreementsAgreementsGenerateInvoice(request, requestOptions));
587
+ }
588
+ async __postV1AgreementsAgreementsGenerateInvoice(request, requestOptions) {
589
+ const _authRequest = await this._options.authProvider.getAuthRequest();
590
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
591
+ const _response = await core.fetcher({
592
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
593
+ (await core.Supplier.get(this._options.environment)) ??
594
+ environments.NordletApiEnvironment.Production, "v1/agreements/agreements/generate-invoice"),
595
+ method: "POST",
596
+ headers: _headers,
597
+ contentType: "application/json",
598
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
599
+ requestType: "json",
600
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions?.additionalBodyParameters),
601
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
602
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
603
+ abortSignal: requestOptions?.abortSignal,
604
+ fetchFn: this._options?.fetch,
605
+ logging: this._options.logging,
606
+ });
607
+ if (_response.ok) {
608
+ return {
609
+ data: _response.body,
610
+ rawResponse: _response.rawResponse,
611
+ };
612
+ }
613
+ if (_response.error.reason === "status-code") {
614
+ switch (_response.error.statusCode) {
615
+ case 400:
616
+ throw new NordletApi.BadRequestError(_response.error.body, _response.rawResponse);
617
+ case 401:
618
+ throw new NordletApi.UnauthorizedError(_response.error.body, _response.rawResponse);
619
+ case 403:
620
+ throw new NordletApi.ForbiddenError(_response.error.body, _response.rawResponse);
621
+ case 404:
622
+ throw new NordletApi.NotFoundError(_response.error.body, _response.rawResponse);
623
+ case 409:
624
+ throw new NordletApi.ConflictError(_response.error.body, _response.rawResponse);
625
+ case 422:
626
+ throw new NordletApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
627
+ case 429:
628
+ throw new NordletApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
629
+ case 500:
630
+ throw new NordletApi.InternalServerError(_response.error.body, _response.rawResponse);
631
+ default:
632
+ throw new errors.NordletApiError({
633
+ statusCode: _response.error.statusCode,
634
+ body: _response.error.body,
635
+ rawResponse: _response.rawResponse,
636
+ });
637
+ }
638
+ }
639
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/agreements/agreements/generate-invoice");
640
+ }
641
+ /**
642
+ * @param {NordletApi.PostV1AgreementsAgreementsBillingRunRequest} request
643
+ * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
644
+ *
645
+ * @throws {@link NordletApi.BadRequestError}
646
+ * @throws {@link NordletApi.UnauthorizedError}
647
+ * @throws {@link NordletApi.ForbiddenError}
648
+ * @throws {@link NordletApi.NotFoundError}
649
+ * @throws {@link NordletApi.ConflictError}
650
+ * @throws {@link NordletApi.UnprocessableEntityError}
651
+ * @throws {@link NordletApi.TooManyRequestsError}
652
+ * @throws {@link NordletApi.InternalServerError}
653
+ *
654
+ * @example
655
+ * await client.agreements.postV1AgreementsAgreementsBillingRun()
656
+ */
657
+ postV1AgreementsAgreementsBillingRun(request = {}, requestOptions) {
658
+ return core.HttpResponsePromise.fromPromise(this.__postV1AgreementsAgreementsBillingRun(request, requestOptions));
659
+ }
660
+ async __postV1AgreementsAgreementsBillingRun(request = {}, requestOptions) {
661
+ const _authRequest = await this._options.authProvider.getAuthRequest();
662
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
663
+ const _response = await core.fetcher({
664
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
665
+ (await core.Supplier.get(this._options.environment)) ??
666
+ environments.NordletApiEnvironment.Production, "v1/agreements/agreements/billing/run"),
667
+ method: "POST",
668
+ headers: _headers,
669
+ contentType: "application/json",
670
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
671
+ requestType: "json",
672
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions?.additionalBodyParameters),
673
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
674
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
675
+ abortSignal: requestOptions?.abortSignal,
676
+ fetchFn: this._options?.fetch,
677
+ logging: this._options.logging,
678
+ });
679
+ if (_response.ok) {
680
+ return {
681
+ data: _response.body,
682
+ rawResponse: _response.rawResponse,
683
+ };
684
+ }
685
+ if (_response.error.reason === "status-code") {
686
+ switch (_response.error.statusCode) {
687
+ case 400:
688
+ throw new NordletApi.BadRequestError(_response.error.body, _response.rawResponse);
689
+ case 401:
690
+ throw new NordletApi.UnauthorizedError(_response.error.body, _response.rawResponse);
691
+ case 403:
692
+ throw new NordletApi.ForbiddenError(_response.error.body, _response.rawResponse);
693
+ case 404:
694
+ throw new NordletApi.NotFoundError(_response.error.body, _response.rawResponse);
695
+ case 409:
696
+ throw new NordletApi.ConflictError(_response.error.body, _response.rawResponse);
697
+ case 422:
698
+ throw new NordletApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
699
+ case 429:
700
+ throw new NordletApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
701
+ case 500:
702
+ throw new NordletApi.InternalServerError(_response.error.body, _response.rawResponse);
703
+ default:
704
+ throw new errors.NordletApiError({
705
+ statusCode: _response.error.statusCode,
706
+ body: _response.error.body,
707
+ rawResponse: _response.rawResponse,
708
+ });
709
+ }
710
+ }
711
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/agreements/agreements/billing/run");
712
+ }
567
713
  /**
568
714
  * @param {NordletApi.PostV1AgreementsInsurancePoliciesCreateRequest} request
569
715
  * @param {AgreementsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface PostV1AgreementsAgreementsBillingRunRequest {
6
+ asOfDate?: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,12 +15,19 @@ export interface PostV1AgreementsAgreementsCreateRequest {
15
15
  endDate?: string;
16
16
  autoRenew?: boolean;
17
17
  value?: string;
18
+ billingPeriod?: PostV1AgreementsAgreementsCreateRequest.BillingPeriod;
18
19
  currency?: string;
19
20
  status?: PostV1AgreementsAgreementsCreateRequest.Status;
20
21
  notes?: string;
21
22
  items?: PostV1AgreementsAgreementsCreateRequest.Items.Item[];
22
23
  }
23
24
  export declare namespace PostV1AgreementsAgreementsCreateRequest {
25
+ const BillingPeriod: {
26
+ readonly Monthly: "monthly";
27
+ readonly Quarterly: "quarterly";
28
+ readonly Annual: "annual";
29
+ };
30
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
24
31
  const Status: {
25
32
  readonly Draft: "draft";
26
33
  readonly Active: "active";
@@ -35,6 +42,7 @@ export declare namespace PostV1AgreementsAgreementsCreateRequest {
35
42
  description: string;
36
43
  quantity?: string | undefined;
37
44
  unitPrice?: string | undefined;
45
+ vatRatePercent?: string | undefined;
38
46
  }
39
47
  }
40
48
  }
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PostV1AgreementsAgreementsCreateRequest = void 0;
5
5
  var PostV1AgreementsAgreementsCreateRequest;
6
6
  (function (PostV1AgreementsAgreementsCreateRequest) {
7
+ PostV1AgreementsAgreementsCreateRequest.BillingPeriod = {
8
+ Monthly: "monthly",
9
+ Quarterly: "quarterly",
10
+ Annual: "annual",
11
+ };
7
12
  PostV1AgreementsAgreementsCreateRequest.Status = {
8
13
  Draft: "draft",
9
14
  Active: "active",
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface PostV1AgreementsAgreementsGenerateInvoiceRequest {
8
+ id: string;
9
+ asOfDate?: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,10 +11,17 @@ export interface PostV1AgreementsAgreementsUpdateRequest {
11
11
  endDate?: string | null;
12
12
  autoRenew?: boolean;
13
13
  value?: string | null;
14
+ billingPeriod?: PostV1AgreementsAgreementsUpdateRequest.BillingPeriod | null;
14
15
  status?: PostV1AgreementsAgreementsUpdateRequest.Status;
15
16
  notes?: string | null;
16
17
  }
17
18
  export declare namespace PostV1AgreementsAgreementsUpdateRequest {
19
+ const BillingPeriod: {
20
+ readonly Monthly: "monthly";
21
+ readonly Quarterly: "quarterly";
22
+ readonly Annual: "annual";
23
+ };
24
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
18
25
  const Status: {
19
26
  readonly Draft: "draft";
20
27
  readonly Active: "active";
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PostV1AgreementsAgreementsUpdateRequest = void 0;
5
5
  var PostV1AgreementsAgreementsUpdateRequest;
6
6
  (function (PostV1AgreementsAgreementsUpdateRequest) {
7
+ PostV1AgreementsAgreementsUpdateRequest.BillingPeriod = {
8
+ Monthly: "monthly",
9
+ Quarterly: "quarterly",
10
+ Annual: "annual",
11
+ };
7
12
  PostV1AgreementsAgreementsUpdateRequest.Status = {
8
13
  Draft: "draft",
9
14
  Active: "active",
@@ -1,5 +1,7 @@
1
+ export type { PostV1AgreementsAgreementsBillingRunRequest } from "./PostV1AgreementsAgreementsBillingRunRequest.js";
1
2
  export { PostV1AgreementsAgreementsCreateRequest } from "./PostV1AgreementsAgreementsCreateRequest.js";
2
3
  export type { PostV1AgreementsAgreementsDeleteRequest } from "./PostV1AgreementsAgreementsDeleteRequest.js";
4
+ export type { PostV1AgreementsAgreementsGenerateInvoiceRequest } from "./PostV1AgreementsAgreementsGenerateInvoiceRequest.js";
3
5
  export type { PostV1AgreementsAgreementsGetRequest } from "./PostV1AgreementsAgreementsGetRequest.js";
4
6
  export { PostV1AgreementsAgreementsListRequest } from "./PostV1AgreementsAgreementsListRequest.js";
5
7
  export { PostV1AgreementsAgreementsUpdateRequest } from "./PostV1AgreementsAgreementsUpdateRequest.js";
@@ -0,0 +1,23 @@
1
+ export interface PostV1AgreementsAgreementsBillingRunResponse {
2
+ generated: PostV1AgreementsAgreementsBillingRunResponse.Generated.Item[];
3
+ expired: string[];
4
+ errors: PostV1AgreementsAgreementsBillingRunResponse.Errors.Item[];
5
+ }
6
+ export declare namespace PostV1AgreementsAgreementsBillingRunResponse {
7
+ type Generated = Generated.Item[];
8
+ namespace Generated {
9
+ interface Item {
10
+ agreementId: string;
11
+ invoiceId: string;
12
+ periodStart: string;
13
+ periodEnd: string;
14
+ }
15
+ }
16
+ type Errors = Errors.Item[];
17
+ namespace Errors {
18
+ interface Item {
19
+ agreementId: string;
20
+ message: string;
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,6 +8,7 @@ export interface PostV1AgreementsAgreementsCreateResponse {
8
8
  endDate: string | null;
9
9
  autoRenew: boolean;
10
10
  value: string | null;
11
+ billingPeriod: PostV1AgreementsAgreementsCreateResponse.BillingPeriod | null;
11
12
  currency: string;
12
13
  status: PostV1AgreementsAgreementsCreateResponse.Status;
13
14
  notes: string | null;
@@ -15,6 +16,12 @@ export interface PostV1AgreementsAgreementsCreateResponse {
15
16
  items: PostV1AgreementsAgreementsCreateResponse.Items.Item[];
16
17
  }
17
18
  export declare namespace PostV1AgreementsAgreementsCreateResponse {
19
+ const BillingPeriod: {
20
+ readonly Monthly: "monthly";
21
+ readonly Quarterly: "quarterly";
22
+ readonly Annual: "annual";
23
+ };
24
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
18
25
  const Status: {
19
26
  readonly Draft: "draft";
20
27
  readonly Active: "active";
@@ -30,6 +37,7 @@ export declare namespace PostV1AgreementsAgreementsCreateResponse {
30
37
  description: string;
31
38
  quantity: string | null;
32
39
  unitPrice: string | null;
40
+ vatRatePercent: string | null;
33
41
  }
34
42
  }
35
43
  }
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PostV1AgreementsAgreementsCreateResponse = void 0;
5
5
  var PostV1AgreementsAgreementsCreateResponse;
6
6
  (function (PostV1AgreementsAgreementsCreateResponse) {
7
+ PostV1AgreementsAgreementsCreateResponse.BillingPeriod = {
8
+ Monthly: "monthly",
9
+ Quarterly: "quarterly",
10
+ Annual: "annual",
11
+ };
7
12
  PostV1AgreementsAgreementsCreateResponse.Status = {
8
13
  Draft: "draft",
9
14
  Active: "active",
@@ -0,0 +1,6 @@
1
+ export interface PostV1AgreementsAgreementsGenerateInvoiceResponse {
2
+ invoiceId: string;
3
+ periodStart: string;
4
+ periodEnd: string;
5
+ renewedEndDate: string | null;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,6 +8,7 @@ export interface PostV1AgreementsAgreementsGetResponse {
8
8
  endDate: string | null;
9
9
  autoRenew: boolean;
10
10
  value: string | null;
11
+ billingPeriod: PostV1AgreementsAgreementsGetResponse.BillingPeriod | null;
11
12
  currency: string;
12
13
  status: PostV1AgreementsAgreementsGetResponse.Status;
13
14
  notes: string | null;
@@ -15,6 +16,12 @@ export interface PostV1AgreementsAgreementsGetResponse {
15
16
  items: PostV1AgreementsAgreementsGetResponse.Items.Item[];
16
17
  }
17
18
  export declare namespace PostV1AgreementsAgreementsGetResponse {
19
+ const BillingPeriod: {
20
+ readonly Monthly: "monthly";
21
+ readonly Quarterly: "quarterly";
22
+ readonly Annual: "annual";
23
+ };
24
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
18
25
  const Status: {
19
26
  readonly Draft: "draft";
20
27
  readonly Active: "active";
@@ -30,6 +37,7 @@ export declare namespace PostV1AgreementsAgreementsGetResponse {
30
37
  description: string;
31
38
  quantity: string | null;
32
39
  unitPrice: string | null;
40
+ vatRatePercent: string | null;
33
41
  }
34
42
  }
35
43
  }
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PostV1AgreementsAgreementsGetResponse = void 0;
5
5
  var PostV1AgreementsAgreementsGetResponse;
6
6
  (function (PostV1AgreementsAgreementsGetResponse) {
7
+ PostV1AgreementsAgreementsGetResponse.BillingPeriod = {
8
+ Monthly: "monthly",
9
+ Quarterly: "quarterly",
10
+ Annual: "annual",
11
+ };
7
12
  PostV1AgreementsAgreementsGetResponse.Status = {
8
13
  Draft: "draft",
9
14
  Active: "active",
@@ -17,12 +17,19 @@ export declare namespace PostV1AgreementsAgreementsListResponse {
17
17
  endDate: string | null;
18
18
  autoRenew: boolean;
19
19
  value: string | null;
20
+ billingPeriod: Item.BillingPeriod | null;
20
21
  currency: string;
21
22
  status: Item.Status;
22
23
  notes: string | null;
23
24
  createdAt: string;
24
25
  }
25
26
  namespace Item {
27
+ const BillingPeriod: {
28
+ readonly Monthly: "monthly";
29
+ readonly Quarterly: "quarterly";
30
+ readonly Annual: "annual";
31
+ };
32
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
26
33
  const Status: {
27
34
  readonly Draft: "draft";
28
35
  readonly Active: "active";
@@ -8,6 +8,11 @@ var PostV1AgreementsAgreementsListResponse;
8
8
  (function (Rows) {
9
9
  let Item;
10
10
  (function (Item) {
11
+ Item.BillingPeriod = {
12
+ Monthly: "monthly",
13
+ Quarterly: "quarterly",
14
+ Annual: "annual",
15
+ };
11
16
  Item.Status = {
12
17
  Draft: "draft",
13
18
  Active: "active",
@@ -8,6 +8,7 @@ export interface PostV1AgreementsAgreementsUpdateResponse {
8
8
  endDate: string | null;
9
9
  autoRenew: boolean;
10
10
  value: string | null;
11
+ billingPeriod: PostV1AgreementsAgreementsUpdateResponse.BillingPeriod | null;
11
12
  currency: string;
12
13
  status: PostV1AgreementsAgreementsUpdateResponse.Status;
13
14
  notes: string | null;
@@ -15,6 +16,12 @@ export interface PostV1AgreementsAgreementsUpdateResponse {
15
16
  items: PostV1AgreementsAgreementsUpdateResponse.Items.Item[];
16
17
  }
17
18
  export declare namespace PostV1AgreementsAgreementsUpdateResponse {
19
+ const BillingPeriod: {
20
+ readonly Monthly: "monthly";
21
+ readonly Quarterly: "quarterly";
22
+ readonly Annual: "annual";
23
+ };
24
+ type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod];
18
25
  const Status: {
19
26
  readonly Draft: "draft";
20
27
  readonly Active: "active";
@@ -30,6 +37,7 @@ export declare namespace PostV1AgreementsAgreementsUpdateResponse {
30
37
  description: string;
31
38
  quantity: string | null;
32
39
  unitPrice: string | null;
40
+ vatRatePercent: string | null;
33
41
  }
34
42
  }
35
43
  }
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PostV1AgreementsAgreementsUpdateResponse = void 0;
5
5
  var PostV1AgreementsAgreementsUpdateResponse;
6
6
  (function (PostV1AgreementsAgreementsUpdateResponse) {
7
+ PostV1AgreementsAgreementsUpdateResponse.BillingPeriod = {
8
+ Monthly: "monthly",
9
+ Quarterly: "quarterly",
10
+ Annual: "annual",
11
+ };
7
12
  PostV1AgreementsAgreementsUpdateResponse.Status = {
8
13
  Draft: "draft",
9
14
  Active: "active",
@@ -1,5 +1,7 @@
1
+ export * from "./PostV1AgreementsAgreementsBillingRunResponse.js";
1
2
  export * from "./PostV1AgreementsAgreementsCreateResponse.js";
2
3
  export * from "./PostV1AgreementsAgreementsDeleteResponse.js";
4
+ export * from "./PostV1AgreementsAgreementsGenerateInvoiceResponse.js";
3
5
  export * from "./PostV1AgreementsAgreementsGetResponse.js";
4
6
  export * from "./PostV1AgreementsAgreementsListResponse.js";
5
7
  export * from "./PostV1AgreementsAgreementsUpdateResponse.js";
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./PostV1AgreementsAgreementsBillingRunResponse.js"), exports);
17
18
  __exportStar(require("./PostV1AgreementsAgreementsCreateResponse.js"), exports);
18
19
  __exportStar(require("./PostV1AgreementsAgreementsDeleteResponse.js"), exports);
20
+ __exportStar(require("./PostV1AgreementsAgreementsGenerateInvoiceResponse.js"), exports);
19
21
  __exportStar(require("./PostV1AgreementsAgreementsGetResponse.js"), exports);
20
22
  __exportStar(require("./PostV1AgreementsAgreementsListResponse.js"), exports);
21
23
  __exportStar(require("./PostV1AgreementsAgreementsUpdateResponse.js"), exports);