@maesn/typescript-sdk 0.8.12 → 0.8.16

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 (157) hide show
  1. package/README.md +6 -0
  2. package/esm/funcs/accounting-delete-item.d.ts +11 -0
  3. package/esm/funcs/accounting-delete-item.d.ts.map +1 -0
  4. package/esm/funcs/accounting-delete-item.js +81 -0
  5. package/esm/funcs/accounting-delete-item.js.map +1 -0
  6. package/esm/funcs/accounting-get-journal-entry.js +1 -0
  7. package/esm/funcs/accounting-get-journal-entry.js.map +1 -1
  8. package/esm/funcs/accounting-update-item.d.ts +11 -0
  9. package/esm/funcs/accounting-update-item.d.ts.map +1 -0
  10. package/esm/funcs/accounting-update-item.js +82 -0
  11. package/esm/funcs/accounting-update-item.js.map +1 -0
  12. package/esm/funcs/accounting-update-journal-entry.d.ts +11 -0
  13. package/esm/funcs/accounting-update-journal-entry.d.ts.map +1 -0
  14. package/esm/funcs/accounting-update-journal-entry.js +109 -0
  15. package/esm/funcs/accounting-update-journal-entry.js.map +1 -0
  16. package/esm/funcs/auth-create-end-user-account.js +5 -1
  17. package/esm/funcs/auth-create-end-user-account.js.map +1 -1
  18. package/esm/lib/config.d.ts +3 -3
  19. package/esm/lib/config.js +3 -3
  20. package/esm/lib/encodings.d.ts +10 -9
  21. package/esm/lib/encodings.d.ts.map +1 -1
  22. package/esm/lib/encodings.js +29 -13
  23. package/esm/lib/encodings.js.map +1 -1
  24. package/esm/models/account-response-dto.d.ts +10 -0
  25. package/esm/models/account-response-dto.d.ts.map +1 -1
  26. package/esm/models/account-response-dto.js +11 -0
  27. package/esm/models/account-response-dto.js.map +1 -1
  28. package/esm/models/bank-account-request-common-dto-v2.d.ts +2 -0
  29. package/esm/models/bank-account-request-common-dto-v2.d.ts.map +1 -1
  30. package/esm/models/bank-account-request-common-dto-v2.js +1 -0
  31. package/esm/models/bank-account-request-common-dto-v2.js.map +1 -1
  32. package/esm/models/bank-account-response-common-dto-v2.d.ts +15 -0
  33. package/esm/models/bank-account-response-common-dto-v2.d.ts.map +1 -0
  34. package/esm/models/bank-account-response-common-dto-v2.js +19 -0
  35. package/esm/models/bank-account-response-common-dto-v2.js.map +1 -0
  36. package/esm/models/booking-proposal-response-dto-v2.d.ts +1 -0
  37. package/esm/models/booking-proposal-response-dto-v2.d.ts.map +1 -1
  38. package/esm/models/booking-proposal-response-dto-v2.js +1 -0
  39. package/esm/models/booking-proposal-response-dto-v2.js.map +1 -1
  40. package/esm/models/contact-person-dto-v2.d.ts +2 -0
  41. package/esm/models/contact-person-dto-v2.d.ts.map +1 -1
  42. package/esm/models/contact-person-dto-v2.js +2 -0
  43. package/esm/models/contact-person-dto-v2.js.map +1 -1
  44. package/esm/models/contact-response-dto-v2.d.ts +5 -0
  45. package/esm/models/contact-response-dto-v2.d.ts.map +1 -1
  46. package/esm/models/contact-response-dto-v2.js +5 -0
  47. package/esm/models/contact-response-dto-v2.js.map +1 -1
  48. package/esm/models/create-account-request-dto.d.ts +3 -0
  49. package/esm/models/create-account-request-dto.d.ts.map +1 -1
  50. package/esm/models/create-account-request-dto.js +2 -0
  51. package/esm/models/create-account-request-dto.js.map +1 -1
  52. package/esm/models/create-contact-person-dto-v2.d.ts +4 -0
  53. package/esm/models/create-contact-person-dto-v2.d.ts.map +1 -1
  54. package/esm/models/create-contact-person-dto-v2.js +2 -0
  55. package/esm/models/create-contact-person-dto-v2.js.map +1 -1
  56. package/esm/models/create-contact-request-dto-v2.d.ts +9 -0
  57. package/esm/models/create-contact-request-dto-v2.d.ts.map +1 -1
  58. package/esm/models/create-contact-request-dto-v2.js +5 -0
  59. package/esm/models/create-contact-request-dto-v2.js.map +1 -1
  60. package/esm/models/create-journal-entry-request-dto.d.ts +2 -0
  61. package/esm/models/create-journal-entry-request-dto.d.ts.map +1 -1
  62. package/esm/models/create-journal-entry-request-dto.js +1 -0
  63. package/esm/models/create-journal-entry-request-dto.js.map +1 -1
  64. package/esm/models/create-offer-line-item-request-dto.d.ts +1 -0
  65. package/esm/models/create-offer-line-item-request-dto.d.ts.map +1 -1
  66. package/esm/models/create-offer-line-item-request-dto.js +1 -0
  67. package/esm/models/create-offer-line-item-request-dto.js.map +1 -1
  68. package/esm/models/create-offer-request-dto.d.ts +2 -0
  69. package/esm/models/create-offer-request-dto.d.ts.map +1 -1
  70. package/esm/models/create-offer-request-dto.js +1 -0
  71. package/esm/models/create-offer-request-dto.js.map +1 -1
  72. package/esm/models/create-sales-order-line-item-request-dto.d.ts +4 -0
  73. package/esm/models/create-sales-order-line-item-request-dto.d.ts.map +1 -1
  74. package/esm/models/create-sales-order-line-item-request-dto.js +2 -0
  75. package/esm/models/create-sales-order-line-item-request-dto.js.map +1 -1
  76. package/esm/models/index.d.ts +2 -0
  77. package/esm/models/index.d.ts.map +1 -1
  78. package/esm/models/index.js +2 -0
  79. package/esm/models/index.js.map +1 -1
  80. package/esm/models/journal-entry-response-dto.d.ts +2 -1
  81. package/esm/models/journal-entry-response-dto.d.ts.map +1 -1
  82. package/esm/models/journal-entry-response-dto.js +2 -1
  83. package/esm/models/journal-entry-response-dto.js.map +1 -1
  84. package/esm/models/offer-line-item-response-dto.d.ts +1 -0
  85. package/esm/models/offer-line-item-response-dto.d.ts.map +1 -1
  86. package/esm/models/offer-line-item-response-dto.js +1 -0
  87. package/esm/models/offer-line-item-response-dto.js.map +1 -1
  88. package/esm/models/offer-response-dto.d.ts +1 -0
  89. package/esm/models/offer-response-dto.d.ts.map +1 -1
  90. package/esm/models/offer-response-dto.js +1 -0
  91. package/esm/models/offer-response-dto.js.map +1 -1
  92. package/esm/models/operations/create-end-user-account.d.ts +5 -0
  93. package/esm/models/operations/create-end-user-account.d.ts.map +1 -1
  94. package/esm/models/operations/create-end-user-account.js +1 -0
  95. package/esm/models/operations/create-end-user-account.js.map +1 -1
  96. package/esm/models/operations/delete-item.d.ts +75 -0
  97. package/esm/models/operations/delete-item.d.ts.map +1 -0
  98. package/esm/models/operations/delete-item.js +57 -0
  99. package/esm/models/operations/delete-item.js.map +1 -0
  100. package/esm/models/operations/get-journal-entry.d.ts +5 -0
  101. package/esm/models/operations/get-journal-entry.d.ts.map +1 -1
  102. package/esm/models/operations/get-journal-entry.js +1 -0
  103. package/esm/models/operations/get-journal-entry.js.map +1 -1
  104. package/esm/models/operations/index.d.ts +3 -0
  105. package/esm/models/operations/index.d.ts.map +1 -1
  106. package/esm/models/operations/index.js +3 -0
  107. package/esm/models/operations/index.js.map +1 -1
  108. package/esm/models/operations/update-item.d.ts +77 -0
  109. package/esm/models/operations/update-item.d.ts.map +1 -0
  110. package/esm/models/operations/update-item.js +58 -0
  111. package/esm/models/operations/update-item.js.map +1 -0
  112. package/esm/models/operations/update-journal-entry.d.ts +96 -0
  113. package/esm/models/operations/update-journal-entry.d.ts.map +1 -0
  114. package/esm/models/operations/update-journal-entry.js +83 -0
  115. package/esm/models/operations/update-journal-entry.js.map +1 -0
  116. package/esm/models/tax-rate-request-common-dto.d.ts +18 -0
  117. package/esm/models/tax-rate-request-common-dto.d.ts.map +1 -0
  118. package/esm/models/tax-rate-request-common-dto.js +15 -0
  119. package/esm/models/tax-rate-request-common-dto.js.map +1 -0
  120. package/esm/sdk/accounting.d.ts +3 -0
  121. package/esm/sdk/accounting.d.ts.map +1 -1
  122. package/esm/sdk/accounting.js +12 -0
  123. package/esm/sdk/accounting.js.map +1 -1
  124. package/jsr.json +1 -1
  125. package/package.json +1 -1
  126. package/src/funcs/accounting-delete-item.ts +172 -0
  127. package/src/funcs/accounting-get-journal-entry.ts +1 -0
  128. package/src/funcs/accounting-update-item.ts +173 -0
  129. package/src/funcs/accounting-update-journal-entry.ts +226 -0
  130. package/src/funcs/auth-create-end-user-account.ts +6 -1
  131. package/src/lib/config.ts +3 -3
  132. package/src/lib/encodings.ts +58 -23
  133. package/src/models/account-response-dto.ts +32 -0
  134. package/src/models/bank-account-request-common-dto-v2.ts +3 -0
  135. package/src/models/bank-account-response-common-dto-v2.ts +41 -0
  136. package/src/models/booking-proposal-response-dto-v2.ts +2 -0
  137. package/src/models/contact-person-dto-v2.ts +4 -0
  138. package/src/models/contact-response-dto-v2.ts +14 -0
  139. package/src/models/create-account-request-dto.ts +8 -0
  140. package/src/models/create-contact-person-dto-v2.ts +6 -0
  141. package/src/models/create-contact-request-dto-v2.ts +19 -0
  142. package/src/models/create-journal-entry-request-dto.ts +3 -0
  143. package/src/models/create-offer-line-item-request-dto.ts +1 -0
  144. package/src/models/create-offer-request-dto.ts +3 -0
  145. package/src/models/create-sales-order-line-item-request-dto.ts +6 -0
  146. package/src/models/index.ts +2 -0
  147. package/src/models/journal-entry-response-dto.ts +4 -2
  148. package/src/models/offer-line-item-response-dto.ts +1 -0
  149. package/src/models/offer-response-dto.ts +2 -0
  150. package/src/models/operations/create-end-user-account.ts +6 -0
  151. package/src/models/operations/delete-item.ts +185 -0
  152. package/src/models/operations/get-journal-entry.ts +6 -0
  153. package/src/models/operations/index.ts +3 -0
  154. package/src/models/operations/update-item.ts +188 -0
  155. package/src/models/operations/update-journal-entry.ts +261 -0
  156. package/src/models/tax-rate-request-common-dto.ts +39 -0
  157. package/src/sdk/accounting.ts +36 -0
@@ -9,6 +9,7 @@ export * from "./address.js";
9
9
  export * from "./advance-payment-input.js";
10
10
  export * from "./async-task-response-dto.js";
11
11
  export * from "./bank-account-request-common-dto-v2.js";
12
+ export * from "./bank-account-response-common-dto-v2.js";
12
13
  export * from "./bank-account-response-dto.js";
13
14
  export * from "./bank-account-response.js";
14
15
  export * from "./bank-account.js";
@@ -141,6 +142,7 @@ export * from "./subscription.js";
141
142
  export * from "./system-registration-dto.js";
142
143
  export * from "./task-id-response-dto.js";
143
144
  export * from "./tax-rate-input.js";
145
+ export * from "./tax-rate-request-common-dto.js";
144
146
  export * from "./tax-rate-request-dto-v2.js";
145
147
  export * from "./tax-rate-response-dto.js";
146
148
  export * from "./transaction-response-dto.js";
@@ -238,7 +238,7 @@ export type JournalEntryResponseDto = {
238
238
  description: string | null;
239
239
  documentId: string | null;
240
240
  dueDate?: string | null | undefined;
241
- exchangeRate?: string | null | undefined;
241
+ exchangeRate: string | null;
242
242
  files: Array<string> | null;
243
243
  isProvisional: boolean | null;
244
244
  isReversal: boolean | null;
@@ -250,6 +250,7 @@ export type JournalEntryResponseDto = {
250
250
  taxAssignmentDate?: string | null | undefined;
251
251
  transactionDate: string | null;
252
252
  updatedDate: string | null;
253
+ version: string | null;
253
254
  };
254
255
 
255
256
  /** @internal */
@@ -321,7 +322,7 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
321
322
  description: types.nullable(types.string()),
322
323
  documentId: types.nullable(types.string()),
323
324
  dueDate: z.optional(z.nullable(types.string())),
324
- exchangeRate: z.optional(z.nullable(types.string())),
325
+ exchangeRate: types.nullable(types.string()),
325
326
  files: types.nullable(z.array(types.string())),
326
327
  isProvisional: types.nullable(types.boolean()),
327
328
  isReversal: types.nullable(types.boolean()),
@@ -333,6 +334,7 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
333
334
  taxAssignmentDate: z.optional(z.nullable(types.string())),
334
335
  transactionDate: types.nullable(types.string()),
335
336
  updatedDate: types.nullable(types.string()),
337
+ version: types.nullable(types.string()),
336
338
  });
337
339
 
338
340
  export function journalEntryResponseDtoFromJSON(
@@ -17,6 +17,7 @@ export const OfferLineItemResponseDtoType = {
17
17
  Value: "VALUE",
18
18
  FixedAsset: "FIXED_ASSET",
19
19
  Charge: "CHARGE",
20
+ Service: "SERVICE",
20
21
  } as const;
21
22
  export type OfferLineItemResponseDtoType = ClosedEnum<
22
23
  typeof OfferLineItemResponseDtoType
@@ -30,6 +30,7 @@ export type OfferResponseDto = {
30
30
  contactId: string | null;
31
31
  createdDate: string | null;
32
32
  currency: string | null;
33
+ expirationDate: string | null;
33
34
  lineItems: Array<OfferLineItemResponseDto> | null;
34
35
  name: string | null;
35
36
  offerDate: string | null;
@@ -61,6 +62,7 @@ export const OfferResponseDto$inboundSchema: z.ZodMiniType<
61
62
  contactId: types.nullable(types.string()),
62
63
  createdDate: types.nullable(types.string()),
63
64
  currency: types.nullable(types.string()),
65
+ expirationDate: types.nullable(types.string()),
64
66
  lineItems: types.nullable(z.array(OfferLineItemResponseDto$inboundSchema)),
65
67
  name: types.nullable(types.string()),
66
68
  offerDate: types.nullable(types.string()),
@@ -17,6 +17,10 @@ export type CreateEndUserAccountGlobals = {
17
17
 
18
18
  export type CreateEndUserAccountRequest = {
19
19
  targetSystem: string;
20
+ /**
21
+ * Optional company id to store as the end user's company selection (e.g. a Tripletex accountant client company), so the account and its company are set up in one call.
22
+ */
23
+ companyId?: string | undefined;
20
24
  /**
21
25
  * API key
22
26
  */
@@ -38,6 +42,7 @@ export type CreateEndUserAccountResponse = {
38
42
  /** @internal */
39
43
  export type CreateEndUserAccountRequest$Outbound = {
40
44
  TARGET_SYSTEM: string;
45
+ companyId?: string | undefined;
41
46
  apiKey?: string | undefined;
42
47
  accountKey?: string | undefined;
43
48
  body: models.CreateEndUserRequestDto$Outbound;
@@ -50,6 +55,7 @@ export const CreateEndUserAccountRequest$outboundSchema: z.ZodMiniType<
50
55
  > = z.pipe(
51
56
  z.object({
52
57
  targetSystem: z.string(),
58
+ companyId: z.optional(z.string()),
53
59
  apiKey: z.optional(z.string()),
54
60
  accountKey: z.optional(z.string()),
55
61
  body: models.CreateEndUserRequestDto$outboundSchema,
@@ -0,0 +1,185 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
10
+ import * as models from "../index.js";
11
+
12
+ export type DeleteItemGlobals = {
13
+ apiKey?: string | undefined;
14
+ accountKey?: string | undefined;
15
+ };
16
+
17
+ export type DeleteItemRequest = {
18
+ itemId: string;
19
+ /**
20
+ * Environment name (required for multi-environment systems such as Business Central)
21
+ */
22
+ environmentName?: string | undefined;
23
+ /**
24
+ * ID of the company (required for multi-company target systems)
25
+ */
26
+ companyId?: string | undefined;
27
+ /**
28
+ * API key
29
+ */
30
+ apiKey?: string | undefined;
31
+ /**
32
+ * Account key
33
+ */
34
+ accountKey?: string | undefined;
35
+ };
36
+
37
+ export type DeleteItemPagination = {
38
+ total: number;
39
+ perPage: number;
40
+ currentPage: number;
41
+ totalPages: number;
42
+ };
43
+
44
+ export type DeleteItemMeta = {
45
+ warnings?: Array<string> | null | undefined;
46
+ pagination?: DeleteItemPagination | null | undefined;
47
+ };
48
+
49
+ export type DeleteItemErrors = {};
50
+
51
+ export type DeleteItemRawData = {};
52
+
53
+ /**
54
+ * Item deleted successfully
55
+ */
56
+ export type DeleteItemResponse = {
57
+ meta?: DeleteItemMeta | null | undefined;
58
+ data: models.ItemResponseDto;
59
+ errors: DeleteItemErrors | null;
60
+ rawData: DeleteItemRawData | null;
61
+ };
62
+
63
+ /** @internal */
64
+ export type DeleteItemRequest$Outbound = {
65
+ itemId: string;
66
+ environmentName?: string | undefined;
67
+ companyId?: string | undefined;
68
+ apiKey?: string | undefined;
69
+ accountKey?: string | undefined;
70
+ };
71
+
72
+ /** @internal */
73
+ export const DeleteItemRequest$outboundSchema: z.ZodMiniType<
74
+ DeleteItemRequest$Outbound,
75
+ DeleteItemRequest
76
+ > = z.object({
77
+ itemId: z.string(),
78
+ environmentName: z.optional(z.string()),
79
+ companyId: z.optional(z.string()),
80
+ apiKey: z.optional(z.string()),
81
+ accountKey: z.optional(z.string()),
82
+ });
83
+
84
+ export function deleteItemRequestToJSON(
85
+ deleteItemRequest: DeleteItemRequest,
86
+ ): string {
87
+ return JSON.stringify(
88
+ DeleteItemRequest$outboundSchema.parse(deleteItemRequest),
89
+ );
90
+ }
91
+
92
+ /** @internal */
93
+ export const DeleteItemPagination$inboundSchema: z.ZodMiniType<
94
+ DeleteItemPagination,
95
+ unknown
96
+ > = z.object({
97
+ total: types.number(),
98
+ perPage: types.number(),
99
+ currentPage: types.number(),
100
+ totalPages: types.number(),
101
+ });
102
+
103
+ export function deleteItemPaginationFromJSON(
104
+ jsonString: string,
105
+ ): SafeParseResult<DeleteItemPagination, SDKValidationError> {
106
+ return safeParse(
107
+ jsonString,
108
+ (x) => DeleteItemPagination$inboundSchema.parse(JSON.parse(x)),
109
+ `Failed to parse 'DeleteItemPagination' from JSON`,
110
+ );
111
+ }
112
+
113
+ /** @internal */
114
+ export const DeleteItemMeta$inboundSchema: z.ZodMiniType<
115
+ DeleteItemMeta,
116
+ unknown
117
+ > = z.object({
118
+ warnings: z.optional(z.nullable(z.array(types.string()))),
119
+ pagination: z.optional(
120
+ z.nullable(z.lazy(() => DeleteItemPagination$inboundSchema)),
121
+ ),
122
+ });
123
+
124
+ export function deleteItemMetaFromJSON(
125
+ jsonString: string,
126
+ ): SafeParseResult<DeleteItemMeta, SDKValidationError> {
127
+ return safeParse(
128
+ jsonString,
129
+ (x) => DeleteItemMeta$inboundSchema.parse(JSON.parse(x)),
130
+ `Failed to parse 'DeleteItemMeta' from JSON`,
131
+ );
132
+ }
133
+
134
+ /** @internal */
135
+ export const DeleteItemErrors$inboundSchema: z.ZodMiniType<
136
+ DeleteItemErrors,
137
+ unknown
138
+ > = z.object({});
139
+
140
+ export function deleteItemErrorsFromJSON(
141
+ jsonString: string,
142
+ ): SafeParseResult<DeleteItemErrors, SDKValidationError> {
143
+ return safeParse(
144
+ jsonString,
145
+ (x) => DeleteItemErrors$inboundSchema.parse(JSON.parse(x)),
146
+ `Failed to parse 'DeleteItemErrors' from JSON`,
147
+ );
148
+ }
149
+
150
+ /** @internal */
151
+ export const DeleteItemRawData$inboundSchema: z.ZodMiniType<
152
+ DeleteItemRawData,
153
+ unknown
154
+ > = z.object({});
155
+
156
+ export function deleteItemRawDataFromJSON(
157
+ jsonString: string,
158
+ ): SafeParseResult<DeleteItemRawData, SDKValidationError> {
159
+ return safeParse(
160
+ jsonString,
161
+ (x) => DeleteItemRawData$inboundSchema.parse(JSON.parse(x)),
162
+ `Failed to parse 'DeleteItemRawData' from JSON`,
163
+ );
164
+ }
165
+
166
+ /** @internal */
167
+ export const DeleteItemResponse$inboundSchema: z.ZodMiniType<
168
+ DeleteItemResponse,
169
+ unknown
170
+ > = z.object({
171
+ meta: z.optional(z.nullable(z.lazy(() => DeleteItemMeta$inboundSchema))),
172
+ data: models.ItemResponseDto$inboundSchema,
173
+ errors: types.nullable(z.lazy(() => DeleteItemErrors$inboundSchema)),
174
+ rawData: types.nullable(z.lazy(() => DeleteItemRawData$inboundSchema)),
175
+ });
176
+
177
+ export function deleteItemResponseFromJSON(
178
+ jsonString: string,
179
+ ): SafeParseResult<DeleteItemResponse, SDKValidationError> {
180
+ return safeParse(
181
+ jsonString,
182
+ (x) => DeleteItemResponse$inboundSchema.parse(JSON.parse(x)),
183
+ `Failed to parse 'DeleteItemResponse' from JSON`,
184
+ );
185
+ }
@@ -28,6 +28,10 @@ export type GetJournalEntryRequest = {
28
28
  * Journal code used to scope the journal entry lookup on systems that require it
29
29
  */
30
30
  journalCode?: string | undefined;
31
+ /**
32
+ * Version of the journal entry
33
+ */
34
+ version?: string | undefined;
31
35
  /**
32
36
  * When true, returns the unprocessed response from the upstream target system
33
37
  */
@@ -74,6 +78,7 @@ export type GetJournalEntryRequest$Outbound = {
74
78
  environmentName?: string | undefined;
75
79
  companyId?: string | undefined;
76
80
  journalCode?: string | undefined;
81
+ version?: string | undefined;
77
82
  rawData?: boolean | undefined;
78
83
  apiKey?: string | undefined;
79
84
  accountKey?: string | undefined;
@@ -88,6 +93,7 @@ export const GetJournalEntryRequest$outboundSchema: z.ZodMiniType<
88
93
  environmentName: z.optional(z.string()),
89
94
  companyId: z.optional(z.string()),
90
95
  journalCode: z.optional(z.string()),
96
+ version: z.optional(z.string()),
91
97
  rawData: z.optional(z.boolean()),
92
98
  apiKey: z.optional(z.string()),
93
99
  accountKey: z.optional(z.string()),
@@ -42,6 +42,7 @@ export * from "./create-webhook.js";
42
42
  export * from "./delete-bill.js";
43
43
  export * from "./delete-end-user.js";
44
44
  export * from "./delete-event-subscriptions.js";
45
+ export * from "./delete-item.js";
45
46
  export * from "./delete-payment.js";
46
47
  export * from "./delete-registered-system.js";
47
48
  export * from "./delete-vendor-credit.js";
@@ -157,6 +158,8 @@ export * from "./system-registration.js";
157
158
  export * from "./update-bill-line-item.js";
158
159
  export * from "./update-bill.js";
159
160
  export * from "./update-customer.js";
161
+ export * from "./update-item.js";
162
+ export * from "./update-journal-entry.js";
160
163
  export * from "./update-submission-page-style.js";
161
164
  export * from "./update-supplier.js";
162
165
  export * from "./update-vendor-credit.js";
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
10
+ import * as models from "../index.js";
11
+
12
+ export type UpdateItemGlobals = {
13
+ apiKey?: string | undefined;
14
+ accountKey?: string | undefined;
15
+ };
16
+
17
+ export type UpdateItemRequest = {
18
+ itemId: string;
19
+ /**
20
+ * Environment name (required for multi-environment systems such as Business Central)
21
+ */
22
+ environmentName?: string | undefined;
23
+ /**
24
+ * ID of the company (required for multi-company target systems)
25
+ */
26
+ companyId?: string | undefined;
27
+ /**
28
+ * API key
29
+ */
30
+ apiKey?: string | undefined;
31
+ /**
32
+ * Account key
33
+ */
34
+ accountKey?: string | undefined;
35
+ body: models.CreateItemRequestDto;
36
+ };
37
+
38
+ export type UpdateItemPagination = {
39
+ total: number;
40
+ perPage: number;
41
+ currentPage: number;
42
+ totalPages: number;
43
+ };
44
+
45
+ export type UpdateItemMeta = {
46
+ warnings?: Array<string> | null | undefined;
47
+ pagination?: UpdateItemPagination | null | undefined;
48
+ };
49
+
50
+ export type UpdateItemErrors = {};
51
+
52
+ export type UpdateItemRawData = {};
53
+
54
+ /**
55
+ * Item updated successfully
56
+ */
57
+ export type UpdateItemResponse = {
58
+ meta?: UpdateItemMeta | null | undefined;
59
+ data: models.ItemResponseDto;
60
+ errors: UpdateItemErrors | null;
61
+ rawData: UpdateItemRawData | null;
62
+ };
63
+
64
+ /** @internal */
65
+ export type UpdateItemRequest$Outbound = {
66
+ itemId: string;
67
+ environmentName?: string | undefined;
68
+ companyId?: string | undefined;
69
+ apiKey?: string | undefined;
70
+ accountKey?: string | undefined;
71
+ body: models.CreateItemRequestDto$Outbound;
72
+ };
73
+
74
+ /** @internal */
75
+ export const UpdateItemRequest$outboundSchema: z.ZodMiniType<
76
+ UpdateItemRequest$Outbound,
77
+ UpdateItemRequest
78
+ > = z.object({
79
+ itemId: z.string(),
80
+ environmentName: z.optional(z.string()),
81
+ companyId: z.optional(z.string()),
82
+ apiKey: z.optional(z.string()),
83
+ accountKey: z.optional(z.string()),
84
+ body: models.CreateItemRequestDto$outboundSchema,
85
+ });
86
+
87
+ export function updateItemRequestToJSON(
88
+ updateItemRequest: UpdateItemRequest,
89
+ ): string {
90
+ return JSON.stringify(
91
+ UpdateItemRequest$outboundSchema.parse(updateItemRequest),
92
+ );
93
+ }
94
+
95
+ /** @internal */
96
+ export const UpdateItemPagination$inboundSchema: z.ZodMiniType<
97
+ UpdateItemPagination,
98
+ unknown
99
+ > = z.object({
100
+ total: types.number(),
101
+ perPage: types.number(),
102
+ currentPage: types.number(),
103
+ totalPages: types.number(),
104
+ });
105
+
106
+ export function updateItemPaginationFromJSON(
107
+ jsonString: string,
108
+ ): SafeParseResult<UpdateItemPagination, SDKValidationError> {
109
+ return safeParse(
110
+ jsonString,
111
+ (x) => UpdateItemPagination$inboundSchema.parse(JSON.parse(x)),
112
+ `Failed to parse 'UpdateItemPagination' from JSON`,
113
+ );
114
+ }
115
+
116
+ /** @internal */
117
+ export const UpdateItemMeta$inboundSchema: z.ZodMiniType<
118
+ UpdateItemMeta,
119
+ unknown
120
+ > = z.object({
121
+ warnings: z.optional(z.nullable(z.array(types.string()))),
122
+ pagination: z.optional(
123
+ z.nullable(z.lazy(() => UpdateItemPagination$inboundSchema)),
124
+ ),
125
+ });
126
+
127
+ export function updateItemMetaFromJSON(
128
+ jsonString: string,
129
+ ): SafeParseResult<UpdateItemMeta, SDKValidationError> {
130
+ return safeParse(
131
+ jsonString,
132
+ (x) => UpdateItemMeta$inboundSchema.parse(JSON.parse(x)),
133
+ `Failed to parse 'UpdateItemMeta' from JSON`,
134
+ );
135
+ }
136
+
137
+ /** @internal */
138
+ export const UpdateItemErrors$inboundSchema: z.ZodMiniType<
139
+ UpdateItemErrors,
140
+ unknown
141
+ > = z.object({});
142
+
143
+ export function updateItemErrorsFromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<UpdateItemErrors, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) => UpdateItemErrors$inboundSchema.parse(JSON.parse(x)),
149
+ `Failed to parse 'UpdateItemErrors' from JSON`,
150
+ );
151
+ }
152
+
153
+ /** @internal */
154
+ export const UpdateItemRawData$inboundSchema: z.ZodMiniType<
155
+ UpdateItemRawData,
156
+ unknown
157
+ > = z.object({});
158
+
159
+ export function updateItemRawDataFromJSON(
160
+ jsonString: string,
161
+ ): SafeParseResult<UpdateItemRawData, SDKValidationError> {
162
+ return safeParse(
163
+ jsonString,
164
+ (x) => UpdateItemRawData$inboundSchema.parse(JSON.parse(x)),
165
+ `Failed to parse 'UpdateItemRawData' from JSON`,
166
+ );
167
+ }
168
+
169
+ /** @internal */
170
+ export const UpdateItemResponse$inboundSchema: z.ZodMiniType<
171
+ UpdateItemResponse,
172
+ unknown
173
+ > = z.object({
174
+ meta: z.optional(z.nullable(z.lazy(() => UpdateItemMeta$inboundSchema))),
175
+ data: models.ItemResponseDto$inboundSchema,
176
+ errors: types.nullable(z.lazy(() => UpdateItemErrors$inboundSchema)),
177
+ rawData: types.nullable(z.lazy(() => UpdateItemRawData$inboundSchema)),
178
+ });
179
+
180
+ export function updateItemResponseFromJSON(
181
+ jsonString: string,
182
+ ): SafeParseResult<UpdateItemResponse, SDKValidationError> {
183
+ return safeParse(
184
+ jsonString,
185
+ (x) => UpdateItemResponse$inboundSchema.parse(JSON.parse(x)),
186
+ `Failed to parse 'UpdateItemResponse' from JSON`,
187
+ );
188
+ }