nordlet 0.2.1 → 0.2.2

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 (25) hide show
  1. package/dist/Client.d.ts +3 -0
  2. package/dist/Client.js +28 -24
  3. package/dist/api/resources/index.d.ts +3 -0
  4. package/dist/api/resources/index.js +4 -1
  5. package/dist/api/resources/migration/client/Client.d.ts +57 -0
  6. package/dist/api/resources/migration/client/Client.js +203 -0
  7. package/dist/api/resources/migration/client/index.d.ts +1 -0
  8. package/dist/api/resources/migration/client/index.js +17 -0
  9. package/dist/api/resources/migration/client/requests/PostV1MigrationBooksImportRequest.d.ts +196 -0
  10. package/dist/api/resources/migration/client/requests/PostV1MigrationBooksImportRequest.js +40 -0
  11. package/dist/api/resources/migration/client/requests/PostV1MigrationBooksValidateRequest.d.ts +196 -0
  12. package/dist/api/resources/migration/client/requests/PostV1MigrationBooksValidateRequest.js +40 -0
  13. package/dist/api/resources/migration/client/requests/index.d.ts +2 -0
  14. package/dist/api/resources/migration/client/requests/index.js +7 -0
  15. package/dist/api/resources/migration/exports.d.ts +2 -0
  16. package/dist/api/resources/migration/exports.js +21 -0
  17. package/dist/api/resources/migration/index.d.ts +2 -0
  18. package/dist/api/resources/migration/index.js +18 -0
  19. package/dist/api/resources/migration/types/PostV1MigrationBooksImportResponse.d.ts +71 -0
  20. package/dist/api/resources/migration/types/PostV1MigrationBooksImportResponse.js +3 -0
  21. package/dist/api/resources/migration/types/PostV1MigrationBooksValidateResponse.d.ts +71 -0
  22. package/dist/api/resources/migration/types/PostV1MigrationBooksValidateResponse.js +3 -0
  23. package/dist/api/resources/migration/types/index.d.ts +2 -0
  24. package/dist/api/resources/migration/types/index.js +18 -0
  25. package/package.json +1 -1
package/dist/Client.d.ts CHANGED
@@ -15,6 +15,7 @@ import { FleetClient } from "./api/resources/fleet/client/Client.js";
15
15
  import { HrClient } from "./api/resources/hr/client/Client.js";
16
16
  import { InventoryClient } from "./api/resources/inventory/client/Client.js";
17
17
  import { LedgerClient } from "./api/resources/ledger/client/Client.js";
18
+ import { MigrationClient } from "./api/resources/migration/client/Client.js";
18
19
  import { PartnersClient } from "./api/resources/partners/client/Client.js";
19
20
  import { PayrollClient } from "./api/resources/payroll/client/Client.js";
20
21
  import { PosClient } from "./api/resources/pos/client/Client.js";
@@ -45,6 +46,7 @@ export declare class NordletApiClient {
45
46
  protected _capture: CaptureClient | undefined;
46
47
  protected _declarations: DeclarationsClient | undefined;
47
48
  protected _ledger: LedgerClient | undefined;
49
+ protected _migration: MigrationClient | undefined;
48
50
  protected _assets: AssetsClient | undefined;
49
51
  protected _hr: HrClient | undefined;
50
52
  protected _fleet: FleetClient | undefined;
@@ -75,6 +77,7 @@ export declare class NordletApiClient {
75
77
  get capture(): CaptureClient;
76
78
  get declarations(): DeclarationsClient;
77
79
  get ledger(): LedgerClient;
80
+ get migration(): MigrationClient;
78
81
  get assets(): AssetsClient;
79
82
  get hr(): HrClient;
80
83
  get fleet(): FleetClient;
package/dist/Client.js CHANGED
@@ -52,18 +52,19 @@ const Client_js_14 = require("./api/resources/fleet/client/Client.js");
52
52
  const Client_js_15 = require("./api/resources/hr/client/Client.js");
53
53
  const Client_js_16 = require("./api/resources/inventory/client/Client.js");
54
54
  const Client_js_17 = require("./api/resources/ledger/client/Client.js");
55
- const Client_js_18 = require("./api/resources/partners/client/Client.js");
56
- const Client_js_19 = require("./api/resources/payroll/client/Client.js");
57
- const Client_js_20 = require("./api/resources/pos/client/Client.js");
58
- const Client_js_21 = require("./api/resources/production/client/Client.js");
59
- const Client_js_22 = require("./api/resources/projects/client/Client.js");
60
- const Client_js_23 = require("./api/resources/public/client/Client.js");
61
- const Client_js_24 = require("./api/resources/purchases/client/Client.js");
62
- const Client_js_25 = require("./api/resources/reference/client/Client.js");
63
- const Client_js_26 = require("./api/resources/reports/client/Client.js");
64
- const Client_js_27 = require("./api/resources/sales/client/Client.js");
65
- const Client_js_28 = require("./api/resources/transport/client/Client.js");
66
- const Client_js_29 = require("./api/resources/webhooks/client/Client.js");
55
+ const Client_js_18 = require("./api/resources/migration/client/Client.js");
56
+ const Client_js_19 = require("./api/resources/partners/client/Client.js");
57
+ const Client_js_20 = require("./api/resources/payroll/client/Client.js");
58
+ const Client_js_21 = require("./api/resources/pos/client/Client.js");
59
+ const Client_js_22 = require("./api/resources/production/client/Client.js");
60
+ const Client_js_23 = require("./api/resources/projects/client/Client.js");
61
+ const Client_js_24 = require("./api/resources/public/client/Client.js");
62
+ const Client_js_25 = require("./api/resources/purchases/client/Client.js");
63
+ const Client_js_26 = require("./api/resources/reference/client/Client.js");
64
+ const Client_js_27 = require("./api/resources/reports/client/Client.js");
65
+ const Client_js_28 = require("./api/resources/sales/client/Client.js");
66
+ const Client_js_29 = require("./api/resources/transport/client/Client.js");
67
+ const Client_js_30 = require("./api/resources/webhooks/client/Client.js");
67
68
  const BaseClient_js_1 = require("./BaseClient.js");
68
69
  const core = __importStar(require("./core/index.js"));
69
70
  class NordletApiClient {
@@ -71,19 +72,19 @@ class NordletApiClient {
71
72
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
72
73
  }
73
74
  get reference() {
74
- return (this._reference ?? (this._reference = new Client_js_25.ReferenceClient(this._options)));
75
+ return (this._reference ?? (this._reference = new Client_js_26.ReferenceClient(this._options)));
75
76
  }
76
77
  get partners() {
77
- return (this._partners ?? (this._partners = new Client_js_18.PartnersClient(this._options)));
78
+ return (this._partners ?? (this._partners = new Client_js_19.PartnersClient(this._options)));
78
79
  }
79
80
  get catalog() {
80
81
  return (this._catalog ?? (this._catalog = new Client_js_9.CatalogClient(this._options)));
81
82
  }
82
83
  get sales() {
83
- return (this._sales ?? (this._sales = new Client_js_27.SalesClient(this._options)));
84
+ return (this._sales ?? (this._sales = new Client_js_28.SalesClient(this._options)));
84
85
  }
85
86
  get purchases() {
86
- return (this._purchases ?? (this._purchases = new Client_js_24.PurchasesClient(this._options)));
87
+ return (this._purchases ?? (this._purchases = new Client_js_25.PurchasesClient(this._options)));
87
88
  }
88
89
  get capture() {
89
90
  return (this._capture ?? (this._capture = new Client_js_7.CaptureClient(this._options)));
@@ -94,6 +95,9 @@ class NordletApiClient {
94
95
  get ledger() {
95
96
  return (this._ledger ?? (this._ledger = new Client_js_17.LedgerClient(this._options)));
96
97
  }
98
+ get migration() {
99
+ return (this._migration ?? (this._migration = new Client_js_18.MigrationClient(this._options)));
100
+ }
97
101
  get assets() {
98
102
  return (this._assets ?? (this._assets = new Client_js_3.AssetsClient(this._options)));
99
103
  }
@@ -104,7 +108,7 @@ class NordletApiClient {
104
108
  return (this._fleet ?? (this._fleet = new Client_js_14.FleetClient(this._options)));
105
109
  }
106
110
  get payroll() {
107
- return (this._payroll ?? (this._payroll = new Client_js_19.PayrollClient(this._options)));
111
+ return (this._payroll ?? (this._payroll = new Client_js_20.PayrollClient(this._options)));
108
112
  }
109
113
  get agreements() {
110
114
  return (this._agreements ?? (this._agreements = new Client_js_2.AgreementsClient(this._options)));
@@ -113,7 +117,7 @@ class NordletApiClient {
113
117
  return (this._inventory ?? (this._inventory = new Client_js_16.InventoryClient(this._options)));
114
118
  }
115
119
  get production() {
116
- return (this._production ?? (this._production = new Client_js_21.ProductionClient(this._options)));
120
+ return (this._production ?? (this._production = new Client_js_22.ProductionClient(this._options)));
117
121
  }
118
122
  get ecommerce() {
119
123
  return (this._ecommerce ?? (this._ecommerce = new Client_js_12.EcommerceClient(this._options)));
@@ -122,19 +126,19 @@ class NordletApiClient {
122
126
  return (this._cash ?? (this._cash = new Client_js_8.CashClient(this._options)));
123
127
  }
124
128
  get projects() {
125
- return (this._projects ?? (this._projects = new Client_js_22.ProjectsClient(this._options)));
129
+ return (this._projects ?? (this._projects = new Client_js_23.ProjectsClient(this._options)));
126
130
  }
127
131
  get transport() {
128
- return (this._transport ?? (this._transport = new Client_js_28.TransportClient(this._options)));
132
+ return (this._transport ?? (this._transport = new Client_js_29.TransportClient(this._options)));
129
133
  }
130
134
  get pos() {
131
- return (this._pos ?? (this._pos = new Client_js_20.PosClient(this._options)));
135
+ return (this._pos ?? (this._pos = new Client_js_21.PosClient(this._options)));
132
136
  }
133
137
  get audit() {
134
138
  return (this._audit ?? (this._audit = new Client_js_4.AuditClient(this._options)));
135
139
  }
136
140
  get webhooks() {
137
- return (this._webhooks ?? (this._webhooks = new Client_js_29.WebhooksClient(this._options)));
141
+ return (this._webhooks ?? (this._webhooks = new Client_js_30.WebhooksClient(this._options)));
138
142
  }
139
143
  get bank() {
140
144
  return (this._bank ?? (this._bank = new Client_js_5.BankClient(this._options)));
@@ -143,13 +147,13 @@ class NordletApiClient {
143
147
  return (this._files ?? (this._files = new Client_js_13.FilesClient(this._options)));
144
148
  }
145
149
  get reports() {
146
- return (this._reports ?? (this._reports = new Client_js_26.ReportsClient(this._options)));
150
+ return (this._reports ?? (this._reports = new Client_js_27.ReportsClient(this._options)));
147
151
  }
148
152
  get consolidation() {
149
153
  return (this._consolidation ?? (this._consolidation = new Client_js_10.ConsolidationClient(this._options)));
150
154
  }
151
155
  get public() {
152
- return (this._public ?? (this._public = new Client_js_23.PublicClient(this._options)));
156
+ return (this._public ?? (this._public = new Client_js_24.PublicClient(this._options)));
153
157
  }
154
158
  get billing() {
155
159
  return (this._billing ?? (this._billing = new Client_js_6.BillingClient(this._options)));
@@ -49,6 +49,9 @@ export * from "./inventory/types/index.js";
49
49
  export * from "./ledger/client/requests/index.js";
50
50
  export * as ledger from "./ledger/index.js";
51
51
  export * from "./ledger/types/index.js";
52
+ export * from "./migration/client/requests/index.js";
53
+ export * as migration from "./migration/index.js";
54
+ export * from "./migration/types/index.js";
52
55
  export * from "./partners/client/requests/index.js";
53
56
  export * as partners from "./partners/index.js";
54
57
  export * from "./partners/types/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.webhooks = exports.transport = exports.sales = exports.reports = exports.reference = exports.purchases = exports.public_ = exports.projects = exports.production = exports.pos = exports.payroll = exports.partners = exports.ledger = exports.inventory = exports.hr = exports.fleet = exports.files = exports.ecommerce = exports.declarations = exports.consolidation = exports.catalog = exports.cash = exports.capture = exports.billing = exports.bank = exports.audit = exports.assets = exports.agreements = exports.account = void 0;
39
+ exports.webhooks = exports.transport = exports.sales = exports.reports = exports.reference = exports.purchases = exports.public_ = exports.projects = exports.production = exports.pos = exports.payroll = exports.partners = exports.migration = exports.ledger = exports.inventory = exports.hr = exports.fleet = exports.files = exports.ecommerce = exports.declarations = exports.consolidation = exports.catalog = exports.cash = exports.capture = exports.billing = exports.bank = exports.audit = exports.assets = exports.agreements = exports.account = void 0;
40
40
  __exportStar(require("./account/client/requests/index.js"), exports);
41
41
  exports.account = __importStar(require("./account/index.js"));
42
42
  __exportStar(require("./account/types/index.js"), exports);
@@ -88,6 +88,9 @@ __exportStar(require("./inventory/types/index.js"), exports);
88
88
  __exportStar(require("./ledger/client/requests/index.js"), exports);
89
89
  exports.ledger = __importStar(require("./ledger/index.js"));
90
90
  __exportStar(require("./ledger/types/index.js"), exports);
91
+ __exportStar(require("./migration/client/requests/index.js"), exports);
92
+ exports.migration = __importStar(require("./migration/index.js"));
93
+ __exportStar(require("./migration/types/index.js"), exports);
91
94
  __exportStar(require("./partners/client/requests/index.js"), exports);
92
95
  exports.partners = __importStar(require("./partners/index.js"));
93
96
  __exportStar(require("./partners/types/index.js"), exports);
@@ -0,0 +1,57 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as NordletApi from "../../../index.js";
5
+ export declare namespace MigrationClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class MigrationClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<MigrationClient.Options>;
12
+ constructor(options: MigrationClient.Options);
13
+ /**
14
+ * Runs every check the import runs (accounts, partners, balances, open invoices, assets, stock) and returns the same summary and warnings, then rolls everything back. Nothing is stored.
15
+ *
16
+ * @param {NordletApi.PostV1MigrationBooksValidateRequest} request
17
+ * @param {MigrationClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link NordletApi.BadRequestError}
20
+ * @throws {@link NordletApi.UnauthorizedError}
21
+ * @throws {@link NordletApi.ForbiddenError}
22
+ * @throws {@link NordletApi.NotFoundError}
23
+ * @throws {@link NordletApi.ConflictError}
24
+ * @throws {@link NordletApi.UnprocessableEntityError}
25
+ * @throws {@link NordletApi.TooManyRequestsError}
26
+ * @throws {@link NordletApi.InternalServerError}
27
+ *
28
+ * @example
29
+ * await client.migration.checkAHistoricalBooksPackageWithoutWritingAnything({
30
+ * cutoverDate: "cutoverDate"
31
+ * })
32
+ */
33
+ checkAHistoricalBooksPackageWithoutWritingAnything(request: NordletApi.PostV1MigrationBooksValidateRequest, requestOptions?: MigrationClient.RequestOptions): core.HttpResponsePromise<NordletApi.PostV1MigrationBooksValidateResponse>;
34
+ private __checkAHistoricalBooksPackageWithoutWritingAnything;
35
+ /**
36
+ * Brings a company over from another system in one call: chart of accounts, partners, items, opening balances (or the full journal history), open customer and supplier invoices, fixed assets with their accumulated depreciation, and stock on hand. The whole package is written in one database transaction — if any row fails, nothing is stored.
37
+ *
38
+ * @param {NordletApi.PostV1MigrationBooksImportRequest} request
39
+ * @param {MigrationClient.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link NordletApi.BadRequestError}
42
+ * @throws {@link NordletApi.UnauthorizedError}
43
+ * @throws {@link NordletApi.ForbiddenError}
44
+ * @throws {@link NordletApi.NotFoundError}
45
+ * @throws {@link NordletApi.ConflictError}
46
+ * @throws {@link NordletApi.UnprocessableEntityError}
47
+ * @throws {@link NordletApi.TooManyRequestsError}
48
+ * @throws {@link NordletApi.InternalServerError}
49
+ *
50
+ * @example
51
+ * await client.migration.importHistoricalBooksFromAPreviousAccountingSystem({
52
+ * cutoverDate: "cutoverDate"
53
+ * })
54
+ */
55
+ importHistoricalBooksFromAPreviousAccountingSystem(request: NordletApi.PostV1MigrationBooksImportRequest, requestOptions?: MigrationClient.RequestOptions): core.HttpResponsePromise<NordletApi.PostV1MigrationBooksImportResponse>;
56
+ private __importHistoricalBooksFromAPreviousAccountingSystem;
57
+ }
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.MigrationClient = void 0;
38
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
39
+ const headers_js_1 = require("../../../../core/headers.js");
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const requestBody_js_1 = require("../../../../core/requestBody.js");
42
+ const environments = __importStar(require("../../../../environments.js"));
43
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
44
+ const errors = __importStar(require("../../../../errors/index.js"));
45
+ const NordletApi = __importStar(require("../../../index.js"));
46
+ class MigrationClient {
47
+ constructor(options) {
48
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
49
+ }
50
+ /**
51
+ * Runs every check the import runs (accounts, partners, balances, open invoices, assets, stock) and returns the same summary and warnings, then rolls everything back. Nothing is stored.
52
+ *
53
+ * @param {NordletApi.PostV1MigrationBooksValidateRequest} request
54
+ * @param {MigrationClient.RequestOptions} requestOptions - Request-specific configuration.
55
+ *
56
+ * @throws {@link NordletApi.BadRequestError}
57
+ * @throws {@link NordletApi.UnauthorizedError}
58
+ * @throws {@link NordletApi.ForbiddenError}
59
+ * @throws {@link NordletApi.NotFoundError}
60
+ * @throws {@link NordletApi.ConflictError}
61
+ * @throws {@link NordletApi.UnprocessableEntityError}
62
+ * @throws {@link NordletApi.TooManyRequestsError}
63
+ * @throws {@link NordletApi.InternalServerError}
64
+ *
65
+ * @example
66
+ * await client.migration.checkAHistoricalBooksPackageWithoutWritingAnything({
67
+ * cutoverDate: "cutoverDate"
68
+ * })
69
+ */
70
+ checkAHistoricalBooksPackageWithoutWritingAnything(request, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__checkAHistoricalBooksPackageWithoutWritingAnything(request, requestOptions));
72
+ }
73
+ async __checkAHistoricalBooksPackageWithoutWritingAnything(request, requestOptions) {
74
+ const _authRequest = await this._options.authProvider.getAuthRequest();
75
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
76
+ const _response = await core.fetcher({
77
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
78
+ (await core.Supplier.get(this._options.environment)) ??
79
+ environments.NordletApiEnvironment.Production, "v1/migration/books/validate"),
80
+ method: "POST",
81
+ headers: _headers,
82
+ contentType: "application/json",
83
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
84
+ requestType: "json",
85
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions?.additionalBodyParameters),
86
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
87
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
88
+ abortSignal: requestOptions?.abortSignal,
89
+ fetchFn: this._options?.fetch,
90
+ logging: this._options.logging,
91
+ });
92
+ if (_response.ok) {
93
+ return {
94
+ data: _response.body,
95
+ rawResponse: _response.rawResponse,
96
+ };
97
+ }
98
+ if (_response.error.reason === "status-code") {
99
+ switch (_response.error.statusCode) {
100
+ case 400:
101
+ throw new NordletApi.BadRequestError(_response.error.body, _response.rawResponse);
102
+ case 401:
103
+ throw new NordletApi.UnauthorizedError(_response.error.body, _response.rawResponse);
104
+ case 403:
105
+ throw new NordletApi.ForbiddenError(_response.error.body, _response.rawResponse);
106
+ case 404:
107
+ throw new NordletApi.NotFoundError(_response.error.body, _response.rawResponse);
108
+ case 409:
109
+ throw new NordletApi.ConflictError(_response.error.body, _response.rawResponse);
110
+ case 422:
111
+ throw new NordletApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
112
+ case 429:
113
+ throw new NordletApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
114
+ case 500:
115
+ throw new NordletApi.InternalServerError(_response.error.body, _response.rawResponse);
116
+ default:
117
+ throw new errors.NordletApiError({
118
+ statusCode: _response.error.statusCode,
119
+ body: _response.error.body,
120
+ rawResponse: _response.rawResponse,
121
+ });
122
+ }
123
+ }
124
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/migration/books/validate");
125
+ }
126
+ /**
127
+ * Brings a company over from another system in one call: chart of accounts, partners, items, opening balances (or the full journal history), open customer and supplier invoices, fixed assets with their accumulated depreciation, and stock on hand. The whole package is written in one database transaction — if any row fails, nothing is stored.
128
+ *
129
+ * @param {NordletApi.PostV1MigrationBooksImportRequest} request
130
+ * @param {MigrationClient.RequestOptions} requestOptions - Request-specific configuration.
131
+ *
132
+ * @throws {@link NordletApi.BadRequestError}
133
+ * @throws {@link NordletApi.UnauthorizedError}
134
+ * @throws {@link NordletApi.ForbiddenError}
135
+ * @throws {@link NordletApi.NotFoundError}
136
+ * @throws {@link NordletApi.ConflictError}
137
+ * @throws {@link NordletApi.UnprocessableEntityError}
138
+ * @throws {@link NordletApi.TooManyRequestsError}
139
+ * @throws {@link NordletApi.InternalServerError}
140
+ *
141
+ * @example
142
+ * await client.migration.importHistoricalBooksFromAPreviousAccountingSystem({
143
+ * cutoverDate: "cutoverDate"
144
+ * })
145
+ */
146
+ importHistoricalBooksFromAPreviousAccountingSystem(request, requestOptions) {
147
+ return core.HttpResponsePromise.fromPromise(this.__importHistoricalBooksFromAPreviousAccountingSystem(request, requestOptions));
148
+ }
149
+ async __importHistoricalBooksFromAPreviousAccountingSystem(request, requestOptions) {
150
+ const _authRequest = await this._options.authProvider.getAuthRequest();
151
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
152
+ const _response = await core.fetcher({
153
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
154
+ (await core.Supplier.get(this._options.environment)) ??
155
+ environments.NordletApiEnvironment.Production, "v1/migration/books/import"),
156
+ method: "POST",
157
+ headers: _headers,
158
+ contentType: "application/json",
159
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
160
+ requestType: "json",
161
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions?.additionalBodyParameters),
162
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
163
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
164
+ abortSignal: requestOptions?.abortSignal,
165
+ fetchFn: this._options?.fetch,
166
+ logging: this._options.logging,
167
+ });
168
+ if (_response.ok) {
169
+ return {
170
+ data: _response.body,
171
+ rawResponse: _response.rawResponse,
172
+ };
173
+ }
174
+ if (_response.error.reason === "status-code") {
175
+ switch (_response.error.statusCode) {
176
+ case 400:
177
+ throw new NordletApi.BadRequestError(_response.error.body, _response.rawResponse);
178
+ case 401:
179
+ throw new NordletApi.UnauthorizedError(_response.error.body, _response.rawResponse);
180
+ case 403:
181
+ throw new NordletApi.ForbiddenError(_response.error.body, _response.rawResponse);
182
+ case 404:
183
+ throw new NordletApi.NotFoundError(_response.error.body, _response.rawResponse);
184
+ case 409:
185
+ throw new NordletApi.ConflictError(_response.error.body, _response.rawResponse);
186
+ case 422:
187
+ throw new NordletApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
188
+ case 429:
189
+ throw new NordletApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
190
+ case 500:
191
+ throw new NordletApi.InternalServerError(_response.error.body, _response.rawResponse);
192
+ default:
193
+ throw new errors.NordletApiError({
194
+ statusCode: _response.error.statusCode,
195
+ body: _response.error.body,
196
+ rawResponse: _response.rawResponse,
197
+ });
198
+ }
199
+ }
200
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/migration/books/import");
201
+ }
202
+ }
203
+ exports.MigrationClient = MigrationClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * cutoverDate: "cutoverDate"
5
+ * }
6
+ */
7
+ export interface PostV1MigrationBooksImportRequest {
8
+ cutoverDate: string;
9
+ source?: string;
10
+ accounts?: PostV1MigrationBooksImportRequest.Accounts.Item[];
11
+ partners?: PostV1MigrationBooksImportRequest.Partners.Item[];
12
+ items?: PostV1MigrationBooksImportRequest.Items.Item[];
13
+ openingBalances?: PostV1MigrationBooksImportRequest.OpeningBalances;
14
+ journal?: PostV1MigrationBooksImportRequest.Journal.Item[];
15
+ openReceivables?: PostV1MigrationBooksImportRequest.OpenReceivables.Item[];
16
+ openPayables?: PostV1MigrationBooksImportRequest.OpenPayables.Item[];
17
+ assetGroups?: PostV1MigrationBooksImportRequest.AssetGroups.Item[];
18
+ fixedAssets?: PostV1MigrationBooksImportRequest.FixedAssets.Item[];
19
+ stock?: PostV1MigrationBooksImportRequest.Stock.Item[];
20
+ }
21
+ export declare namespace PostV1MigrationBooksImportRequest {
22
+ type Accounts = Accounts.Item[];
23
+ namespace Accounts {
24
+ interface Item {
25
+ code: string;
26
+ name: string;
27
+ type: Item.Type;
28
+ parentCode?: string | undefined;
29
+ isPostable?: boolean | undefined;
30
+ }
31
+ namespace Item {
32
+ const Type: {
33
+ readonly Asset: "asset";
34
+ readonly Liability: "liability";
35
+ readonly Equity: "equity";
36
+ readonly Income: "income";
37
+ readonly Expense: "expense";
38
+ };
39
+ type Type = (typeof Type)[keyof typeof Type];
40
+ }
41
+ }
42
+ type Partners = Partners.Item[];
43
+ namespace Partners {
44
+ interface Item {
45
+ code: string;
46
+ name: string;
47
+ type?: Item.Type | undefined;
48
+ vatCode?: string | undefined;
49
+ email?: string | undefined;
50
+ phone?: string | undefined;
51
+ isCustomer?: boolean | undefined;
52
+ isSupplier?: boolean | undefined;
53
+ paymentTermDays?: number | undefined;
54
+ address?: Item.Address | undefined;
55
+ notes?: string | undefined;
56
+ }
57
+ namespace Item {
58
+ const Type: {
59
+ readonly Company: "company";
60
+ readonly Person: "person";
61
+ };
62
+ type Type = (typeof Type)[keyof typeof Type];
63
+ interface Address {
64
+ street?: string | undefined;
65
+ city?: string | undefined;
66
+ postalCode?: string | undefined;
67
+ countryCode?: string | undefined;
68
+ }
69
+ }
70
+ }
71
+ type Items = Items.Item[];
72
+ namespace Items {
73
+ interface Item {
74
+ code: string;
75
+ name: string;
76
+ type?: Item.Type | undefined;
77
+ unit?: string | undefined;
78
+ barcode?: string | undefined;
79
+ vatRatePercent?: string | undefined;
80
+ salePriceExclVat?: string | undefined;
81
+ purchasePriceExclVat?: string | undefined;
82
+ description?: string | undefined;
83
+ }
84
+ namespace Item {
85
+ const Type: {
86
+ readonly Product: "product";
87
+ readonly Service: "service";
88
+ };
89
+ type Type = (typeof Type)[keyof typeof Type];
90
+ }
91
+ }
92
+ interface OpeningBalances {
93
+ date?: string | undefined;
94
+ balancingAccountCode?: string | undefined;
95
+ entries: OpeningBalances.Entries.Item[];
96
+ }
97
+ namespace OpeningBalances {
98
+ type Entries = Entries.Item[];
99
+ namespace Entries {
100
+ interface Item {
101
+ accountCode: string;
102
+ debit?: string | undefined;
103
+ credit?: string | undefined;
104
+ description?: string | undefined;
105
+ }
106
+ }
107
+ }
108
+ type Journal = Journal.Item[];
109
+ namespace Journal {
110
+ interface Item {
111
+ date: string;
112
+ description?: string | undefined;
113
+ reference?: string | undefined;
114
+ entries: Item.Entries.Item[];
115
+ }
116
+ namespace Item {
117
+ type Entries = Entries.Item[];
118
+ namespace Entries {
119
+ interface Item {
120
+ accountCode: string;
121
+ debit?: string | undefined;
122
+ credit?: string | undefined;
123
+ description?: string | undefined;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ type OpenReceivables = OpenReceivables.Item[];
129
+ namespace OpenReceivables {
130
+ interface Item {
131
+ partnerCode: string;
132
+ dueDate?: string | undefined;
133
+ currency?: string | undefined;
134
+ grossTotal: string;
135
+ vatTotal?: string | undefined;
136
+ outstanding?: string | undefined;
137
+ fxRate?: string | undefined;
138
+ notes?: string | undefined;
139
+ number: string;
140
+ issueDate: string;
141
+ }
142
+ }
143
+ type OpenPayables = OpenPayables.Item[];
144
+ namespace OpenPayables {
145
+ interface Item {
146
+ partnerCode: string;
147
+ dueDate?: string | undefined;
148
+ currency?: string | undefined;
149
+ grossTotal: string;
150
+ vatTotal?: string | undefined;
151
+ outstanding?: string | undefined;
152
+ fxRate?: string | undefined;
153
+ notes?: string | undefined;
154
+ documentNumber: string;
155
+ documentDate: string;
156
+ }
157
+ }
158
+ type AssetGroups = AssetGroups.Item[];
159
+ namespace AssetGroups {
160
+ interface Item {
161
+ code: string;
162
+ name: string;
163
+ assetAccountCode: string;
164
+ depreciationAccountCode: string;
165
+ expenseAccountCode?: string | undefined;
166
+ defaultUsefulLifeMonths?: number | undefined;
167
+ }
168
+ }
169
+ type FixedAssets = FixedAssets.Item[];
170
+ namespace FixedAssets {
171
+ interface Item {
172
+ groupCode: string;
173
+ code: string;
174
+ name: string;
175
+ acquisitionDate: string;
176
+ depreciationStartDate?: string | undefined;
177
+ acquisitionCost: string;
178
+ salvageValue?: string | undefined;
179
+ usefulLifeMonths?: number | undefined;
180
+ accumulatedDepreciation?: string | undefined;
181
+ depreciatedMonths?: number | undefined;
182
+ notes?: string | undefined;
183
+ }
184
+ }
185
+ type Stock = Stock.Item[];
186
+ namespace Stock {
187
+ interface Item {
188
+ warehouseCode?: string | undefined;
189
+ itemCode: string;
190
+ quantity: string;
191
+ unitCost: string;
192
+ lotNumber?: string | undefined;
193
+ expiryDate?: string | undefined;
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PostV1MigrationBooksImportRequest = void 0;
5
+ var PostV1MigrationBooksImportRequest;
6
+ (function (PostV1MigrationBooksImportRequest) {
7
+ let Accounts;
8
+ (function (Accounts) {
9
+ let Item;
10
+ (function (Item) {
11
+ Item.Type = {
12
+ Asset: "asset",
13
+ Liability: "liability",
14
+ Equity: "equity",
15
+ Income: "income",
16
+ Expense: "expense",
17
+ };
18
+ })(Item = Accounts.Item || (Accounts.Item = {}));
19
+ })(Accounts = PostV1MigrationBooksImportRequest.Accounts || (PostV1MigrationBooksImportRequest.Accounts = {}));
20
+ let Partners;
21
+ (function (Partners) {
22
+ let Item;
23
+ (function (Item) {
24
+ Item.Type = {
25
+ Company: "company",
26
+ Person: "person",
27
+ };
28
+ })(Item = Partners.Item || (Partners.Item = {}));
29
+ })(Partners = PostV1MigrationBooksImportRequest.Partners || (PostV1MigrationBooksImportRequest.Partners = {}));
30
+ let Items;
31
+ (function (Items) {
32
+ let Item;
33
+ (function (Item) {
34
+ Item.Type = {
35
+ Product: "product",
36
+ Service: "service",
37
+ };
38
+ })(Item = Items.Item || (Items.Item = {}));
39
+ })(Items = PostV1MigrationBooksImportRequest.Items || (PostV1MigrationBooksImportRequest.Items = {}));
40
+ })(PostV1MigrationBooksImportRequest || (exports.PostV1MigrationBooksImportRequest = PostV1MigrationBooksImportRequest = {}));
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * cutoverDate: "cutoverDate"
5
+ * }
6
+ */
7
+ export interface PostV1MigrationBooksValidateRequest {
8
+ cutoverDate: string;
9
+ source?: string;
10
+ accounts?: PostV1MigrationBooksValidateRequest.Accounts.Item[];
11
+ partners?: PostV1MigrationBooksValidateRequest.Partners.Item[];
12
+ items?: PostV1MigrationBooksValidateRequest.Items.Item[];
13
+ openingBalances?: PostV1MigrationBooksValidateRequest.OpeningBalances;
14
+ journal?: PostV1MigrationBooksValidateRequest.Journal.Item[];
15
+ openReceivables?: PostV1MigrationBooksValidateRequest.OpenReceivables.Item[];
16
+ openPayables?: PostV1MigrationBooksValidateRequest.OpenPayables.Item[];
17
+ assetGroups?: PostV1MigrationBooksValidateRequest.AssetGroups.Item[];
18
+ fixedAssets?: PostV1MigrationBooksValidateRequest.FixedAssets.Item[];
19
+ stock?: PostV1MigrationBooksValidateRequest.Stock.Item[];
20
+ }
21
+ export declare namespace PostV1MigrationBooksValidateRequest {
22
+ type Accounts = Accounts.Item[];
23
+ namespace Accounts {
24
+ interface Item {
25
+ code: string;
26
+ name: string;
27
+ type: Item.Type;
28
+ parentCode?: string | undefined;
29
+ isPostable?: boolean | undefined;
30
+ }
31
+ namespace Item {
32
+ const Type: {
33
+ readonly Asset: "asset";
34
+ readonly Liability: "liability";
35
+ readonly Equity: "equity";
36
+ readonly Income: "income";
37
+ readonly Expense: "expense";
38
+ };
39
+ type Type = (typeof Type)[keyof typeof Type];
40
+ }
41
+ }
42
+ type Partners = Partners.Item[];
43
+ namespace Partners {
44
+ interface Item {
45
+ code: string;
46
+ name: string;
47
+ type?: Item.Type | undefined;
48
+ vatCode?: string | undefined;
49
+ email?: string | undefined;
50
+ phone?: string | undefined;
51
+ isCustomer?: boolean | undefined;
52
+ isSupplier?: boolean | undefined;
53
+ paymentTermDays?: number | undefined;
54
+ address?: Item.Address | undefined;
55
+ notes?: string | undefined;
56
+ }
57
+ namespace Item {
58
+ const Type: {
59
+ readonly Company: "company";
60
+ readonly Person: "person";
61
+ };
62
+ type Type = (typeof Type)[keyof typeof Type];
63
+ interface Address {
64
+ street?: string | undefined;
65
+ city?: string | undefined;
66
+ postalCode?: string | undefined;
67
+ countryCode?: string | undefined;
68
+ }
69
+ }
70
+ }
71
+ type Items = Items.Item[];
72
+ namespace Items {
73
+ interface Item {
74
+ code: string;
75
+ name: string;
76
+ type?: Item.Type | undefined;
77
+ unit?: string | undefined;
78
+ barcode?: string | undefined;
79
+ vatRatePercent?: string | undefined;
80
+ salePriceExclVat?: string | undefined;
81
+ purchasePriceExclVat?: string | undefined;
82
+ description?: string | undefined;
83
+ }
84
+ namespace Item {
85
+ const Type: {
86
+ readonly Product: "product";
87
+ readonly Service: "service";
88
+ };
89
+ type Type = (typeof Type)[keyof typeof Type];
90
+ }
91
+ }
92
+ interface OpeningBalances {
93
+ date?: string | undefined;
94
+ balancingAccountCode?: string | undefined;
95
+ entries: OpeningBalances.Entries.Item[];
96
+ }
97
+ namespace OpeningBalances {
98
+ type Entries = Entries.Item[];
99
+ namespace Entries {
100
+ interface Item {
101
+ accountCode: string;
102
+ debit?: string | undefined;
103
+ credit?: string | undefined;
104
+ description?: string | undefined;
105
+ }
106
+ }
107
+ }
108
+ type Journal = Journal.Item[];
109
+ namespace Journal {
110
+ interface Item {
111
+ date: string;
112
+ description?: string | undefined;
113
+ reference?: string | undefined;
114
+ entries: Item.Entries.Item[];
115
+ }
116
+ namespace Item {
117
+ type Entries = Entries.Item[];
118
+ namespace Entries {
119
+ interface Item {
120
+ accountCode: string;
121
+ debit?: string | undefined;
122
+ credit?: string | undefined;
123
+ description?: string | undefined;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ type OpenReceivables = OpenReceivables.Item[];
129
+ namespace OpenReceivables {
130
+ interface Item {
131
+ partnerCode: string;
132
+ dueDate?: string | undefined;
133
+ currency?: string | undefined;
134
+ grossTotal: string;
135
+ vatTotal?: string | undefined;
136
+ outstanding?: string | undefined;
137
+ fxRate?: string | undefined;
138
+ notes?: string | undefined;
139
+ number: string;
140
+ issueDate: string;
141
+ }
142
+ }
143
+ type OpenPayables = OpenPayables.Item[];
144
+ namespace OpenPayables {
145
+ interface Item {
146
+ partnerCode: string;
147
+ dueDate?: string | undefined;
148
+ currency?: string | undefined;
149
+ grossTotal: string;
150
+ vatTotal?: string | undefined;
151
+ outstanding?: string | undefined;
152
+ fxRate?: string | undefined;
153
+ notes?: string | undefined;
154
+ documentNumber: string;
155
+ documentDate: string;
156
+ }
157
+ }
158
+ type AssetGroups = AssetGroups.Item[];
159
+ namespace AssetGroups {
160
+ interface Item {
161
+ code: string;
162
+ name: string;
163
+ assetAccountCode: string;
164
+ depreciationAccountCode: string;
165
+ expenseAccountCode?: string | undefined;
166
+ defaultUsefulLifeMonths?: number | undefined;
167
+ }
168
+ }
169
+ type FixedAssets = FixedAssets.Item[];
170
+ namespace FixedAssets {
171
+ interface Item {
172
+ groupCode: string;
173
+ code: string;
174
+ name: string;
175
+ acquisitionDate: string;
176
+ depreciationStartDate?: string | undefined;
177
+ acquisitionCost: string;
178
+ salvageValue?: string | undefined;
179
+ usefulLifeMonths?: number | undefined;
180
+ accumulatedDepreciation?: string | undefined;
181
+ depreciatedMonths?: number | undefined;
182
+ notes?: string | undefined;
183
+ }
184
+ }
185
+ type Stock = Stock.Item[];
186
+ namespace Stock {
187
+ interface Item {
188
+ warehouseCode?: string | undefined;
189
+ itemCode: string;
190
+ quantity: string;
191
+ unitCost: string;
192
+ lotNumber?: string | undefined;
193
+ expiryDate?: string | undefined;
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PostV1MigrationBooksValidateRequest = void 0;
5
+ var PostV1MigrationBooksValidateRequest;
6
+ (function (PostV1MigrationBooksValidateRequest) {
7
+ let Accounts;
8
+ (function (Accounts) {
9
+ let Item;
10
+ (function (Item) {
11
+ Item.Type = {
12
+ Asset: "asset",
13
+ Liability: "liability",
14
+ Equity: "equity",
15
+ Income: "income",
16
+ Expense: "expense",
17
+ };
18
+ })(Item = Accounts.Item || (Accounts.Item = {}));
19
+ })(Accounts = PostV1MigrationBooksValidateRequest.Accounts || (PostV1MigrationBooksValidateRequest.Accounts = {}));
20
+ let Partners;
21
+ (function (Partners) {
22
+ let Item;
23
+ (function (Item) {
24
+ Item.Type = {
25
+ Company: "company",
26
+ Person: "person",
27
+ };
28
+ })(Item = Partners.Item || (Partners.Item = {}));
29
+ })(Partners = PostV1MigrationBooksValidateRequest.Partners || (PostV1MigrationBooksValidateRequest.Partners = {}));
30
+ let Items;
31
+ (function (Items) {
32
+ let Item;
33
+ (function (Item) {
34
+ Item.Type = {
35
+ Product: "product",
36
+ Service: "service",
37
+ };
38
+ })(Item = Items.Item || (Items.Item = {}));
39
+ })(Items = PostV1MigrationBooksValidateRequest.Items || (PostV1MigrationBooksValidateRequest.Items = {}));
40
+ })(PostV1MigrationBooksValidateRequest || (exports.PostV1MigrationBooksValidateRequest = PostV1MigrationBooksValidateRequest = {}));
@@ -0,0 +1,2 @@
1
+ export { PostV1MigrationBooksImportRequest } from "./PostV1MigrationBooksImportRequest.js";
2
+ export { PostV1MigrationBooksValidateRequest } from "./PostV1MigrationBooksValidateRequest.js";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostV1MigrationBooksValidateRequest = exports.PostV1MigrationBooksImportRequest = void 0;
4
+ var PostV1MigrationBooksImportRequest_js_1 = require("./PostV1MigrationBooksImportRequest.js");
5
+ Object.defineProperty(exports, "PostV1MigrationBooksImportRequest", { enumerable: true, get: function () { return PostV1MigrationBooksImportRequest_js_1.PostV1MigrationBooksImportRequest; } });
6
+ var PostV1MigrationBooksValidateRequest_js_1 = require("./PostV1MigrationBooksValidateRequest.js");
7
+ Object.defineProperty(exports, "PostV1MigrationBooksValidateRequest", { enumerable: true, get: function () { return PostV1MigrationBooksValidateRequest_js_1.PostV1MigrationBooksValidateRequest; } });
@@ -0,0 +1,2 @@
1
+ export { MigrationClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.MigrationClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "MigrationClient", { enumerable: true, get: function () { return Client_js_1.MigrationClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,71 @@
1
+ export interface PostV1MigrationBooksImportResponse {
2
+ dryRun: boolean;
3
+ cutoverDate: string;
4
+ accounts: PostV1MigrationBooksImportResponse.Accounts;
5
+ partners: PostV1MigrationBooksImportResponse.Partners;
6
+ items: PostV1MigrationBooksImportResponse.Items;
7
+ assetGroups: PostV1MigrationBooksImportResponse.AssetGroups;
8
+ openingBalances: PostV1MigrationBooksImportResponse.OpeningBalances | null;
9
+ journal: PostV1MigrationBooksImportResponse.Journal;
10
+ openReceivables: PostV1MigrationBooksImportResponse.OpenReceivables;
11
+ openPayables: PostV1MigrationBooksImportResponse.OpenPayables;
12
+ fixedAssets: PostV1MigrationBooksImportResponse.FixedAssets;
13
+ stock: PostV1MigrationBooksImportResponse.Stock;
14
+ numberSeries: PostV1MigrationBooksImportResponse.NumberSeries.Item[];
15
+ warnings: string[];
16
+ }
17
+ export declare namespace PostV1MigrationBooksImportResponse {
18
+ interface Accounts {
19
+ created: number;
20
+ existing: number;
21
+ }
22
+ interface Partners {
23
+ created: number;
24
+ existing: number;
25
+ }
26
+ interface Items {
27
+ created: number;
28
+ existing: number;
29
+ }
30
+ interface AssetGroups {
31
+ created: number;
32
+ existing: number;
33
+ }
34
+ interface OpeningBalances {
35
+ journalTransactionId: string | null;
36
+ date: string;
37
+ entries: number;
38
+ debitTotal: string;
39
+ creditTotal: string;
40
+ balancingAmount: string;
41
+ }
42
+ interface Journal {
43
+ transactions: number;
44
+ entries: number;
45
+ }
46
+ interface OpenReceivables {
47
+ created: number;
48
+ outstandingTotal: string;
49
+ }
50
+ interface OpenPayables {
51
+ created: number;
52
+ outstandingTotal: string;
53
+ }
54
+ interface FixedAssets {
55
+ created: number;
56
+ costTotal: string;
57
+ accumulatedDepreciationTotal: string;
58
+ }
59
+ interface Stock {
60
+ movements: number;
61
+ costTotal: string;
62
+ }
63
+ type NumberSeries = NumberSeries.Item[];
64
+ namespace NumberSeries {
65
+ interface Item {
66
+ prefix: string;
67
+ year: number;
68
+ nextNumber: number;
69
+ }
70
+ }
71
+ }
@@ -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 });
@@ -0,0 +1,71 @@
1
+ export interface PostV1MigrationBooksValidateResponse {
2
+ dryRun: boolean;
3
+ cutoverDate: string;
4
+ accounts: PostV1MigrationBooksValidateResponse.Accounts;
5
+ partners: PostV1MigrationBooksValidateResponse.Partners;
6
+ items: PostV1MigrationBooksValidateResponse.Items;
7
+ assetGroups: PostV1MigrationBooksValidateResponse.AssetGroups;
8
+ openingBalances: PostV1MigrationBooksValidateResponse.OpeningBalances | null;
9
+ journal: PostV1MigrationBooksValidateResponse.Journal;
10
+ openReceivables: PostV1MigrationBooksValidateResponse.OpenReceivables;
11
+ openPayables: PostV1MigrationBooksValidateResponse.OpenPayables;
12
+ fixedAssets: PostV1MigrationBooksValidateResponse.FixedAssets;
13
+ stock: PostV1MigrationBooksValidateResponse.Stock;
14
+ numberSeries: PostV1MigrationBooksValidateResponse.NumberSeries.Item[];
15
+ warnings: string[];
16
+ }
17
+ export declare namespace PostV1MigrationBooksValidateResponse {
18
+ interface Accounts {
19
+ created: number;
20
+ existing: number;
21
+ }
22
+ interface Partners {
23
+ created: number;
24
+ existing: number;
25
+ }
26
+ interface Items {
27
+ created: number;
28
+ existing: number;
29
+ }
30
+ interface AssetGroups {
31
+ created: number;
32
+ existing: number;
33
+ }
34
+ interface OpeningBalances {
35
+ journalTransactionId: string | null;
36
+ date: string;
37
+ entries: number;
38
+ debitTotal: string;
39
+ creditTotal: string;
40
+ balancingAmount: string;
41
+ }
42
+ interface Journal {
43
+ transactions: number;
44
+ entries: number;
45
+ }
46
+ interface OpenReceivables {
47
+ created: number;
48
+ outstandingTotal: string;
49
+ }
50
+ interface OpenPayables {
51
+ created: number;
52
+ outstandingTotal: string;
53
+ }
54
+ interface FixedAssets {
55
+ created: number;
56
+ costTotal: string;
57
+ accumulatedDepreciationTotal: string;
58
+ }
59
+ interface Stock {
60
+ movements: number;
61
+ costTotal: string;
62
+ }
63
+ type NumberSeries = NumberSeries.Item[];
64
+ namespace NumberSeries {
65
+ interface Item {
66
+ prefix: string;
67
+ year: number;
68
+ nextNumber: number;
69
+ }
70
+ }
71
+ }
@@ -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 });
@@ -0,0 +1,2 @@
1
+ export * from "./PostV1MigrationBooksImportResponse.js";
2
+ export * from "./PostV1MigrationBooksValidateResponse.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./PostV1MigrationBooksImportResponse.js"), exports);
18
+ __exportStar(require("./PostV1MigrationBooksValidateResponse.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nordlet",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Official TypeScript/JavaScript SDK for the Nordlet Accounting API",
5
5
  "license": "MIT",
6
6
  "repository": "github:nordlet/nordlet-sdk-typescript",