@maesn/typescript-sdk 0.7.0 → 0.8.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 (126) hide show
  1. package/esm/funcs/accounting-create-journal-entry-attachments.d.ts.map +1 -1
  2. package/esm/funcs/accounting-create-journal-entry-attachments.js +5 -1
  3. package/esm/funcs/accounting-create-journal-entry-attachments.js.map +1 -1
  4. package/esm/hooks/types.d.ts +1 -0
  5. package/esm/hooks/types.d.ts.map +1 -1
  6. package/esm/lib/config.d.ts +3 -3
  7. package/esm/lib/config.js +3 -3
  8. package/esm/lib/encodings.js +1 -1
  9. package/esm/lib/encodings.js.map +1 -1
  10. package/esm/lib/env.d.ts.map +1 -1
  11. package/esm/lib/env.js +3 -3
  12. package/esm/lib/env.js.map +1 -1
  13. package/esm/lib/matchers.js +1 -1
  14. package/esm/lib/matchers.js.map +1 -1
  15. package/esm/lib/primitives.d.ts +1 -0
  16. package/esm/lib/primitives.d.ts.map +1 -1
  17. package/esm/lib/primitives.js +17 -0
  18. package/esm/lib/primitives.js.map +1 -1
  19. package/esm/lib/sdks.d.ts.map +1 -1
  20. package/esm/lib/sdks.js +50 -16
  21. package/esm/lib/sdks.js.map +1 -1
  22. package/esm/models/advance-payment-input.d.ts +27 -0
  23. package/esm/models/advance-payment-input.d.ts.map +1 -0
  24. package/esm/models/advance-payment-input.js +24 -0
  25. package/esm/models/advance-payment-input.js.map +1 -0
  26. package/esm/models/contact-response-dto.d.ts +1 -1
  27. package/esm/models/contact-response-dto.d.ts.map +1 -1
  28. package/esm/models/contact-response-dto.js +1 -1
  29. package/esm/models/contact-response-dto.js.map +1 -1
  30. package/esm/models/create-journal-entry-request-dto.d.ts +3 -0
  31. package/esm/models/create-journal-entry-request-dto.d.ts.map +1 -1
  32. package/esm/models/create-journal-entry-request-dto.js +2 -0
  33. package/esm/models/create-journal-entry-request-dto.js.map +1 -1
  34. package/esm/models/dimension.d.ts +1 -1
  35. package/esm/models/dimension.d.ts.map +1 -1
  36. package/esm/models/dimension.js +1 -1
  37. package/esm/models/dimension.js.map +1 -1
  38. package/esm/models/email-address.d.ts +2 -2
  39. package/esm/models/email-address.d.ts.map +1 -1
  40. package/esm/models/email-address.js +2 -2
  41. package/esm/models/email-address.js.map +1 -1
  42. package/esm/models/fiscal-year-response-dto.d.ts +9 -0
  43. package/esm/models/fiscal-year-response-dto.d.ts.map +1 -1
  44. package/esm/models/fiscal-year-response-dto.js +8 -0
  45. package/esm/models/fiscal-year-response-dto.js.map +1 -1
  46. package/esm/models/index.d.ts +1 -0
  47. package/esm/models/index.d.ts.map +1 -1
  48. package/esm/models/index.js +1 -0
  49. package/esm/models/index.js.map +1 -1
  50. package/esm/models/invoice-response-dto.d.ts +1 -1
  51. package/esm/models/invoice-response-dto.d.ts.map +1 -1
  52. package/esm/models/invoice-response-dto.js +1 -1
  53. package/esm/models/invoice-response-dto.js.map +1 -1
  54. package/esm/models/journal-entry-response-dto.d.ts +23 -3
  55. package/esm/models/journal-entry-response-dto.d.ts.map +1 -1
  56. package/esm/models/journal-entry-response-dto.js +23 -3
  57. package/esm/models/journal-entry-response-dto.js.map +1 -1
  58. package/esm/models/journal-line-item.d.ts +1 -1
  59. package/esm/models/journal-line-item.d.ts.map +1 -1
  60. package/esm/models/journal-line-item.js +1 -1
  61. package/esm/models/journal-line-item.js.map +1 -1
  62. package/esm/models/line-item-response-dto.d.ts +1 -1
  63. package/esm/models/line-item-response-dto.d.ts.map +1 -1
  64. package/esm/models/line-item-response-dto.js +1 -1
  65. package/esm/models/line-item-response-dto.js.map +1 -1
  66. package/esm/models/line-item-response.d.ts +1 -1
  67. package/esm/models/line-item-response.d.ts.map +1 -1
  68. package/esm/models/line-item-response.js +1 -1
  69. package/esm/models/line-item-response.js.map +1 -1
  70. package/esm/models/offer-response-dto.d.ts +1 -1
  71. package/esm/models/offer-response-dto.d.ts.map +1 -1
  72. package/esm/models/offer-response-dto.js +1 -1
  73. package/esm/models/offer-response-dto.js.map +1 -1
  74. package/esm/models/operations/create-journal-entry-attachments.d.ts +5 -0
  75. package/esm/models/operations/create-journal-entry-attachments.d.ts.map +1 -1
  76. package/esm/models/operations/create-journal-entry-attachments.js +1 -0
  77. package/esm/models/operations/create-journal-entry-attachments.js.map +1 -1
  78. package/esm/models/payment-line.d.ts +2 -2
  79. package/esm/models/payment-line.d.ts.map +1 -1
  80. package/esm/models/payment-line.js +2 -2
  81. package/esm/models/payment-line.js.map +1 -1
  82. package/esm/models/phone-number.d.ts +2 -2
  83. package/esm/models/phone-number.d.ts.map +1 -1
  84. package/esm/models/phone-number.js +2 -2
  85. package/esm/models/phone-number.js.map +1 -1
  86. package/esm/models/sales-order-response-dto.d.ts +1 -1
  87. package/esm/models/sales-order-response-dto.d.ts.map +1 -1
  88. package/esm/models/sales-order-response-dto.js +1 -1
  89. package/esm/models/sales-order-response-dto.js.map +1 -1
  90. package/jsr.json +1 -1
  91. package/package.json +1 -1
  92. package/src/funcs/accounting-create-journal-entry-attachments.ts +11 -1
  93. package/src/hooks/types.ts +1 -0
  94. package/src/lib/config.ts +3 -3
  95. package/src/lib/encodings.ts +1 -1
  96. package/src/lib/env.ts +7 -3
  97. package/src/lib/matchers.ts +1 -1
  98. package/src/lib/primitives.ts +16 -0
  99. package/src/lib/sdks.ts +54 -17
  100. package/src/models/advance-payment-input.ts +52 -0
  101. package/src/models/contact-response-dto.ts +2 -2
  102. package/src/models/create-journal-entry-request-dto.ts +8 -0
  103. package/src/models/dimension.ts +2 -2
  104. package/src/models/email-address.ts +4 -4
  105. package/src/models/fiscal-year-response-dto.ts +14 -0
  106. package/src/models/index.ts +1 -0
  107. package/src/models/invoice-response-dto.ts +2 -2
  108. package/src/models/journal-entry-response-dto.ts +52 -6
  109. package/src/models/journal-line-item.ts +2 -2
  110. package/src/models/line-item-response-dto.ts +2 -2
  111. package/src/models/line-item-response.ts +2 -2
  112. package/src/models/offer-response-dto.ts +2 -2
  113. package/src/models/operations/create-journal-entry-attachments.ts +6 -0
  114. package/src/models/payment-line.ts +4 -4
  115. package/src/models/phone-number.ts +4 -4
  116. package/src/models/sales-order-response-dto.ts +2 -2
  117. package/esm/lib/dlv.d.ts +0 -14
  118. package/esm/lib/dlv.d.ts.map +0 -1
  119. package/esm/lib/dlv.js +0 -46
  120. package/esm/lib/dlv.js.map +0 -1
  121. package/esm/lib/is-plain-object.d.ts +0 -2
  122. package/esm/lib/is-plain-object.d.ts.map +0 -1
  123. package/esm/lib/is-plain-object.js +0 -38
  124. package/esm/lib/is-plain-object.js.map +0 -1
  125. package/src/lib/dlv.ts +0 -53
  126. package/src/lib/is-plain-object.ts +0 -43
@@ -54,7 +54,7 @@ export type ContactResponseDto = {
54
54
  projectId: string | null;
55
55
  role: ContactResponseDtoRole | null;
56
56
  updatedDate: string | null;
57
- vatId?: string | null | undefined;
57
+ vatId: string | null;
58
58
  };
59
59
 
60
60
  /** @internal */
@@ -88,7 +88,7 @@ export const ContactResponseDto$inboundSchema: z.ZodMiniType<
88
88
  projectId: types.nullable(types.string()),
89
89
  role: types.nullable(ContactResponseDtoRole$inboundSchema),
90
90
  updatedDate: types.nullable(types.string()),
91
- vatId: z.optional(z.nullable(types.string())),
91
+ vatId: types.nullable(types.string()),
92
92
  });
93
93
 
94
94
  export function contactResponseDtoFromJSON(
@@ -4,6 +4,11 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { ClosedEnum } from "../types/enums.js";
7
+ import {
8
+ AdvancePaymentInput,
9
+ AdvancePaymentInput$Outbound,
10
+ AdvancePaymentInput$outboundSchema,
11
+ } from "./advance-payment-input.js";
7
12
  import {
8
13
  CreateJournalLineItem,
9
14
  CreateJournalLineItem$Outbound,
@@ -183,6 +188,7 @@ export type CreateJournalEntryRequestDtoDebitCreditIndicator = ClosedEnum<
183
188
  export type CreateJournalEntryRequestDto = {
184
189
  accountId?: string | undefined;
185
190
  accountingPeriodId?: string | undefined;
191
+ advancePayment?: AdvancePaymentInput | undefined;
186
192
  currency?: CreateJournalEntryRequestDtoCurrency | undefined;
187
193
  debitCreditIndicator?:
188
194
  | CreateJournalEntryRequestDtoDebitCreditIndicator
@@ -215,6 +221,7 @@ export const CreateJournalEntryRequestDtoDebitCreditIndicator$outboundSchema:
215
221
  export type CreateJournalEntryRequestDto$Outbound = {
216
222
  accountId?: string | undefined;
217
223
  accountingPeriodId?: string | undefined;
224
+ advancePayment?: AdvancePaymentInput$Outbound | undefined;
218
225
  currency?: string | undefined;
219
226
  debitCreditIndicator?: string | undefined;
220
227
  deliveryDate?: string | undefined;
@@ -238,6 +245,7 @@ export const CreateJournalEntryRequestDto$outboundSchema: z.ZodMiniType<
238
245
  > = z.object({
239
246
  accountId: z.optional(z.string()),
240
247
  accountingPeriodId: z.optional(z.string()),
248
+ advancePayment: z.optional(AdvancePaymentInput$outboundSchema),
241
249
  currency: z.optional(CreateJournalEntryRequestDtoCurrency$outboundSchema),
242
250
  debitCreditIndicator: z.optional(
243
251
  CreateJournalEntryRequestDtoDebitCreditIndicator$outboundSchema,
@@ -11,7 +11,7 @@ import { SDKValidationError } from "./errors/sdk-validation-error.js";
11
11
  export type Dimension = {
12
12
  id: string | null;
13
13
  categoryName: string | null;
14
- code?: string | null | undefined;
14
+ code: string | null;
15
15
  name: string | null;
16
16
  };
17
17
 
@@ -20,7 +20,7 @@ export const Dimension$inboundSchema: z.ZodMiniType<Dimension, unknown> = z
20
20
  .object({
21
21
  id: types.nullable(types.string()),
22
22
  categoryName: types.nullable(types.string()),
23
- code: z.optional(z.nullable(types.string())),
23
+ code: types.nullable(types.string()),
24
24
  name: types.nullable(types.string()),
25
25
  });
26
26
 
@@ -20,8 +20,8 @@ export const EmailAddressType = {
20
20
  export type EmailAddressType = ClosedEnum<typeof EmailAddressType>;
21
21
 
22
22
  export type EmailAddress = {
23
- email: string | null;
24
- type: EmailAddressType | null;
23
+ email?: string | null | undefined;
24
+ type?: EmailAddressType | null | undefined;
25
25
  };
26
26
 
27
27
  /** @internal */
@@ -32,8 +32,8 @@ export const EmailAddressType$inboundSchema: z.ZodMiniEnum<
32
32
  /** @internal */
33
33
  export const EmailAddress$inboundSchema: z.ZodMiniType<EmailAddress, unknown> =
34
34
  z.object({
35
- email: types.nullable(types.string()),
36
- type: types.nullable(EmailAddressType$inboundSchema),
35
+ email: z.optional(z.nullable(types.string())),
36
+ type: z.optional(z.nullable(EmailAddressType$inboundSchema)),
37
37
  });
38
38
 
39
39
  export function emailAddressFromJSON(
@@ -9,6 +9,13 @@ import { Result as SafeParseResult } from "../types/fp.js";
9
9
  import * as types from "../types/primitives.js";
10
10
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
11
11
 
12
+ export const AvailableLedger = {
13
+ AccountPayable: "ACCOUNT_PAYABLE",
14
+ AccountReceivable: "ACCOUNT_RECEIVABLE",
15
+ CashLedger: "CASH_LEDGER",
16
+ } as const;
17
+ export type AvailableLedger = ClosedEnum<typeof AvailableLedger>;
18
+
12
19
  export const FiscalYearResponseDtoChartOfAccount = {
13
20
  Skr03: "SKR03",
14
21
  Skr04: "SKR04",
@@ -31,6 +38,7 @@ export type FiscalYearResponseDtoStatus = ClosedEnum<
31
38
  export type FiscalYearResponseDto = {
32
39
  id: string;
33
40
  accountNumberLength: number;
41
+ availableLedgers: Array<AvailableLedger>;
34
42
  chartOfAccount: FiscalYearResponseDtoChartOfAccount;
35
43
  createdDate: string;
36
44
  description: string;
@@ -40,6 +48,11 @@ export type FiscalYearResponseDto = {
40
48
  updatedDate: string;
41
49
  };
42
50
 
51
+ /** @internal */
52
+ export const AvailableLedger$inboundSchema: z.ZodMiniEnum<
53
+ typeof AvailableLedger
54
+ > = z.enum(AvailableLedger);
55
+
43
56
  /** @internal */
44
57
  export const FiscalYearResponseDtoChartOfAccount$inboundSchema: z.ZodMiniEnum<
45
58
  typeof FiscalYearResponseDtoChartOfAccount
@@ -57,6 +70,7 @@ export const FiscalYearResponseDto$inboundSchema: z.ZodMiniType<
57
70
  > = z.object({
58
71
  id: types.string(),
59
72
  accountNumberLength: types.number(),
73
+ availableLedgers: z.array(AvailableLedger$inboundSchema),
60
74
  chartOfAccount: FiscalYearResponseDtoChartOfAccount$inboundSchema,
61
75
  createdDate: types.string(),
62
76
  description: types.string(),
@@ -6,6 +6,7 @@ export * from "./account-request-common-dto-v2.js";
6
6
  export * from "./account-response-dto.js";
7
7
  export * from "./address-offer.js";
8
8
  export * from "./address.js";
9
+ export * from "./advance-payment-input.js";
9
10
  export * from "./async-task-response-dto.js";
10
11
  export * from "./bank-account-request-common-dto-v2.js";
11
12
  export * from "./bank-account-response-dto.js";
@@ -94,7 +94,7 @@ export type InvoiceResponseDto = {
94
94
  currency: string | null;
95
95
  discountAmount: number | null;
96
96
  dueDate: string | null;
97
- fileId?: string | null | undefined;
97
+ fileId: string | null;
98
98
  invoiceDate: string | null;
99
99
  invoiceNumber: string | null;
100
100
  invoiceType: InvoiceResponseDtoInvoiceType | null;
@@ -155,7 +155,7 @@ export const InvoiceResponseDto$inboundSchema: z.ZodMiniType<
155
155
  currency: types.nullable(types.string()),
156
156
  discountAmount: types.nullable(types.number()),
157
157
  dueDate: types.nullable(types.string()),
158
- fileId: z.optional(z.nullable(types.string())),
158
+ fileId: types.nullable(types.string()),
159
159
  invoiceDate: types.nullable(types.string()),
160
160
  invoiceNumber: types.nullable(types.string()),
161
161
  invoiceType: types.nullable(InvoiceResponseDtoInvoiceType$inboundSchema),
@@ -13,6 +13,24 @@ import {
13
13
  JournalLineItem$inboundSchema,
14
14
  } from "./journal-line-item.js";
15
15
 
16
+ export const JournalEntryResponseDtoType = {
17
+ AdvanceInvoiceRequested: "ADVANCE_INVOICE_REQUESTED",
18
+ AdvancePaymentReceived: "ADVANCE_PAYMENT_RECEIVED",
19
+ AdvanceLiabilityTransfer: "ADVANCE_LIABILITY_TRANSFER",
20
+ FinalInvoice: "FINAL_INVOICE",
21
+ FinalInvoiceClearing: "FINAL_INVOICE_CLEARING",
22
+ FinalPaymentReceived: "FINAL_PAYMENT_RECEIVED",
23
+ Other: "OTHER",
24
+ } as const;
25
+ export type JournalEntryResponseDtoType = ClosedEnum<
26
+ typeof JournalEntryResponseDtoType
27
+ >;
28
+
29
+ export type AdvancePayment = {
30
+ orderNumber: string | null;
31
+ type: JournalEntryResponseDtoType | null;
32
+ };
33
+
16
34
  export const JournalEntryResponseDtoCurrency = {
17
35
  Aed: "AED",
18
36
  Afn: "AFN",
@@ -187,6 +205,7 @@ export type JournalEntryResponseDto = {
187
205
  id: string | null;
188
206
  accountId: string | null;
189
207
  accountingPeriodId: string | null;
208
+ advancePayment?: AdvancePayment | null | undefined;
190
209
  createdDate: string | null;
191
210
  currency: JournalEntryResponseDtoCurrency | null;
192
211
  debitCreditIndicator?:
@@ -199,16 +218,40 @@ export type JournalEntryResponseDto = {
199
218
  dueDate?: string | null | undefined;
200
219
  exchangeRate?: string | null | undefined;
201
220
  files: Array<string> | null;
202
- isProvisional?: boolean | null | undefined;
203
- journalCode?: string | null | undefined;
221
+ isProvisional: boolean | null;
222
+ journalCode: string | null;
204
223
  journalLineItems: Array<JournalLineItem> | null;
205
- journalType?: string | null | undefined;
224
+ journalType: string | null;
206
225
  number: string | null;
207
226
  taxAssignmentDate?: string | null | undefined;
208
227
  transactionDate: string | null;
209
228
  updatedDate: string | null;
210
229
  };
211
230
 
231
+ /** @internal */
232
+ export const JournalEntryResponseDtoType$inboundSchema: z.ZodMiniEnum<
233
+ typeof JournalEntryResponseDtoType
234
+ > = z.enum(JournalEntryResponseDtoType);
235
+
236
+ /** @internal */
237
+ export const AdvancePayment$inboundSchema: z.ZodMiniType<
238
+ AdvancePayment,
239
+ unknown
240
+ > = z.object({
241
+ orderNumber: types.nullable(types.string()),
242
+ type: types.nullable(JournalEntryResponseDtoType$inboundSchema),
243
+ });
244
+
245
+ export function advancePaymentFromJSON(
246
+ jsonString: string,
247
+ ): SafeParseResult<AdvancePayment, SDKValidationError> {
248
+ return safeParse(
249
+ jsonString,
250
+ (x) => AdvancePayment$inboundSchema.parse(JSON.parse(x)),
251
+ `Failed to parse 'AdvancePayment' from JSON`,
252
+ );
253
+ }
254
+
212
255
  /** @internal */
213
256
  export const JournalEntryResponseDtoCurrency$inboundSchema: z.ZodMiniEnum<
214
257
  typeof JournalEntryResponseDtoCurrency
@@ -228,6 +271,9 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
228
271
  id: types.nullable(types.string()),
229
272
  accountId: types.nullable(types.string()),
230
273
  accountingPeriodId: types.nullable(types.string()),
274
+ advancePayment: z.optional(
275
+ z.nullable(z.lazy(() => AdvancePayment$inboundSchema)),
276
+ ),
231
277
  createdDate: types.nullable(types.string()),
232
278
  currency: types.nullable(JournalEntryResponseDtoCurrency$inboundSchema),
233
279
  debitCreditIndicator: z.optional(
@@ -239,10 +285,10 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
239
285
  dueDate: z.optional(z.nullable(types.string())),
240
286
  exchangeRate: z.optional(z.nullable(types.string())),
241
287
  files: types.nullable(z.array(types.string())),
242
- isProvisional: z.optional(z.nullable(types.boolean())),
243
- journalCode: z.optional(z.nullable(types.string())),
288
+ isProvisional: types.nullable(types.boolean()),
289
+ journalCode: types.nullable(types.string()),
244
290
  journalLineItems: types.nullable(z.array(JournalLineItem$inboundSchema)),
245
- journalType: z.optional(z.nullable(types.string())),
291
+ journalType: types.nullable(types.string()),
246
292
  number: types.nullable(types.string()),
247
293
  taxAssignmentDate: z.optional(z.nullable(types.string())),
248
294
  transactionDate: types.nullable(types.string()),
@@ -191,7 +191,7 @@ export type JournalLineItem = {
191
191
  id: string | null;
192
192
  accountCode: string | null;
193
193
  accountId: string | null;
194
- accountNumber?: number | null | undefined;
194
+ accountNumber: number | null;
195
195
  createdDate: string | null;
196
196
  currency: JournalLineItemCurrency | null;
197
197
  customerId: string | null;
@@ -249,7 +249,7 @@ export const JournalLineItem$inboundSchema: z.ZodMiniType<
249
249
  id: types.nullable(types.string()),
250
250
  accountCode: types.nullable(types.string()),
251
251
  accountId: types.nullable(types.string()),
252
- accountNumber: z.optional(z.nullable(types.number())),
252
+ accountNumber: types.nullable(types.number()),
253
253
  createdDate: types.nullable(types.string()),
254
254
  currency: types.nullable(JournalLineItemCurrency$inboundSchema),
255
255
  customerId: types.nullable(types.string()),
@@ -25,7 +25,7 @@ export type LineItemResponseDto = {
25
25
  itemId: string | null;
26
26
  name: string | null;
27
27
  quantity: number | null;
28
- taxCode?: string | null | undefined;
28
+ taxCode: string | null;
29
29
  taxRatePercentage: number | null;
30
30
  unitAmount: number | null;
31
31
  updatedDate: string | null;
@@ -50,7 +50,7 @@ export const LineItemResponseDto$inboundSchema: z.ZodMiniType<
50
50
  itemId: types.nullable(types.string()),
51
51
  name: types.nullable(types.string()),
52
52
  quantity: types.nullable(types.number()),
53
- taxCode: z.optional(z.nullable(types.string())),
53
+ taxCode: types.nullable(types.string()),
54
54
  taxRatePercentage: types.nullable(types.number()),
55
55
  unitAmount: types.nullable(types.number()),
56
56
  updatedDate: types.nullable(types.string()),
@@ -39,7 +39,7 @@ export type LineItemResponse = {
39
39
  taxRatePercentage: number | null;
40
40
  totalGrossAmount: number | null;
41
41
  totalNetAmount: number | null;
42
- type?: LineItemResponseType | null | undefined;
42
+ type: LineItemResponseType | null;
43
43
  updatedDate: string | null;
44
44
  };
45
45
 
@@ -74,7 +74,7 @@ export const LineItemResponse$inboundSchema: z.ZodMiniType<
74
74
  taxRatePercentage: types.nullable(types.number()),
75
75
  totalGrossAmount: types.nullable(types.number()),
76
76
  totalNetAmount: types.nullable(types.number()),
77
- type: z.optional(z.nullable(LineItemResponseType$inboundSchema)),
77
+ type: types.nullable(LineItemResponseType$inboundSchema),
78
78
  updatedDate: types.nullable(types.string()),
79
79
  });
80
80
 
@@ -27,7 +27,7 @@ export type OfferResponseDtoStatus = ClosedEnum<typeof OfferResponseDtoStatus>;
27
27
  export type OfferResponseDto = {
28
28
  id: string | null;
29
29
  addresses: Array<AddressOffer> | null;
30
- contactId?: string | null | undefined;
30
+ contactId: string | null;
31
31
  createdDate: string | null;
32
32
  currency: string | null;
33
33
  lineItems: Array<OfferLineItemResponseDto> | null;
@@ -58,7 +58,7 @@ export const OfferResponseDto$inboundSchema: z.ZodMiniType<
58
58
  > = z.object({
59
59
  id: types.nullable(types.string()),
60
60
  addresses: types.nullable(z.array(AddressOffer$inboundSchema)),
61
- contactId: z.optional(z.nullable(types.string())),
61
+ contactId: types.nullable(types.string()),
62
62
  createdDate: types.nullable(types.string()),
63
63
  currency: types.nullable(types.string()),
64
64
  lineItems: types.nullable(z.array(OfferLineItemResponseDto$inboundSchema)),
@@ -26,6 +26,10 @@ export type CreateJournalEntryAttachmentsRequestBody = {
26
26
 
27
27
  export type CreateJournalEntryAttachmentsRequest = {
28
28
  journalEntryId: string;
29
+ /**
30
+ * ID of the company (required for multi-company target systems)
31
+ */
32
+ companyId?: string | undefined;
29
33
  /**
30
34
  * API key
31
35
  */
@@ -126,6 +130,7 @@ export function createJournalEntryAttachmentsRequestBodyToJSON(
126
130
  /** @internal */
127
131
  export type CreateJournalEntryAttachmentsRequest$Outbound = {
128
132
  journalEntryId: string;
133
+ companyId?: string | undefined;
129
134
  apiKey?: string | undefined;
130
135
  accountKey?: string | undefined;
131
136
  body: CreateJournalEntryAttachmentsRequestBody$Outbound;
@@ -137,6 +142,7 @@ export const CreateJournalEntryAttachmentsRequest$outboundSchema: z.ZodMiniType<
137
142
  CreateJournalEntryAttachmentsRequest
138
143
  > = z.object({
139
144
  journalEntryId: z.string(),
145
+ companyId: z.optional(z.string()),
140
146
  apiKey: z.optional(z.string()),
141
147
  accountKey: z.optional(z.string()),
142
148
  body: z.lazy(() => CreateJournalEntryAttachmentsRequestBody$outboundSchema),
@@ -12,8 +12,8 @@ export type PaymentLine = {
12
12
  accountId: string | null;
13
13
  amount: number | null;
14
14
  contactName: string | null;
15
- contactId?: string | null | undefined;
16
- customerId?: string | null | undefined;
15
+ contactId: string | null;
16
+ customerId: string | null;
17
17
  description: string | null;
18
18
  invoiceId: string | null;
19
19
  supplierId: string | null;
@@ -26,8 +26,8 @@ export const PaymentLine$inboundSchema: z.ZodMiniType<PaymentLine, unknown> = z
26
26
  accountId: types.nullable(types.string()),
27
27
  amount: types.nullable(types.number()),
28
28
  contactName: types.nullable(types.string()),
29
- contactId: z.optional(z.nullable(types.string())),
30
- customerId: z.optional(z.nullable(types.string())),
29
+ contactId: types.nullable(types.string()),
30
+ customerId: types.nullable(types.string()),
31
31
  description: types.nullable(types.string()),
32
32
  invoiceId: types.nullable(types.string()),
33
33
  supplierId: types.nullable(types.string()),
@@ -23,8 +23,8 @@ export const PhoneNumberType = {
23
23
  export type PhoneNumberType = ClosedEnum<typeof PhoneNumberType>;
24
24
 
25
25
  export type PhoneNumber = {
26
- number: string | null;
27
- type: PhoneNumberType | null;
26
+ number?: string | null | undefined;
27
+ type?: PhoneNumberType | null | undefined;
28
28
  };
29
29
 
30
30
  /** @internal */
@@ -35,8 +35,8 @@ export const PhoneNumberType$inboundSchema: z.ZodMiniEnum<
35
35
  /** @internal */
36
36
  export const PhoneNumber$inboundSchema: z.ZodMiniType<PhoneNumber, unknown> = z
37
37
  .object({
38
- number: types.nullable(types.string()),
39
- type: types.nullable(PhoneNumberType$inboundSchema),
38
+ number: z.optional(z.nullable(types.string())),
39
+ type: z.optional(z.nullable(PhoneNumberType$inboundSchema)),
40
40
  });
41
41
 
42
42
  export function phoneNumberFromJSON(
@@ -35,7 +35,7 @@ export type SalesOrderResponseDto = {
35
35
  currency: string | null;
36
36
  deliveryDate: string | null;
37
37
  lineItems: Array<SalesOrderLineItemResponseDto> | null;
38
- oneLineAddress?: string | null | undefined;
38
+ oneLineAddress: string | null;
39
39
  orderDate: string | null;
40
40
  projectId: string | null;
41
41
  shippingContactId: string | null;
@@ -70,7 +70,7 @@ export const SalesOrderResponseDto$inboundSchema: z.ZodMiniType<
70
70
  lineItems: types.nullable(
71
71
  z.array(SalesOrderLineItemResponseDto$inboundSchema),
72
72
  ),
73
- oneLineAddress: z.optional(z.nullable(types.string())),
73
+ oneLineAddress: types.nullable(types.string()),
74
74
  orderDate: types.nullable(types.string()),
75
75
  projectId: types.nullable(types.string()),
76
76
  shippingContactId: types.nullable(types.string()),
package/esm/lib/dlv.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * @param obj The object to walk
3
- * @param key The key path to walk the object with
4
- * @param def A default value to return if the result is undefined
5
- *
6
- * @example
7
- * dlv(obj, "a.b.c.d")
8
- * @example
9
- * dlv(object, ["a", "b", "c", "d"])
10
- * @example
11
- * dlv(object, "foo.bar.baz", "Hello, default value!")
12
- */
13
- export declare function dlv<T = any>(obj: any, key: string | string[], def?: T, p?: number, undef?: never): T | undefined;
14
- //# sourceMappingURL=dlv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dlv.d.ts","sourceRoot":"","sources":["../../src/lib/dlv.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,GAAG,CAAC,EAAE,CAAC,EACP,CAAC,CAAC,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC,GAAG,SAAS,CAOf"}
package/esm/lib/dlv.js DELETED
@@ -1,46 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- /*
5
- MIT License
6
-
7
- Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy of
10
- this software and associated documentation files (the "Software"), to deal in
11
- the Software without restriction, including without limitation the rights to
12
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13
- the Software, and to permit persons to whom the Software is furnished to do so,
14
- subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
- */
26
- /**
27
- * @param obj The object to walk
28
- * @param key The key path to walk the object with
29
- * @param def A default value to return if the result is undefined
30
- *
31
- * @example
32
- * dlv(obj, "a.b.c.d")
33
- * @example
34
- * dlv(object, ["a", "b", "c", "d"])
35
- * @example
36
- * dlv(object, "foo.bar.baz", "Hello, default value!")
37
- */
38
- export function dlv(obj, key, def, p, undef) {
39
- key = Array.isArray(key) ? key : key.split(".");
40
- for (p = 0; p < key.length; p++) {
41
- const k = key[p];
42
- obj = k != null && obj ? obj[k] : undef;
43
- }
44
- return obj === undef ? def : obj;
45
- }
46
- //# sourceMappingURL=dlv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dlv.js","sourceRoot":"","sources":["../../src/lib/dlv.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,GAAG,CACjB,GAAQ,EACR,GAAsB,EACtB,GAAO,EACP,CAAU,EACV,KAAa,EACE;IACf,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAAA,CAClC"}
@@ -1,2 +0,0 @@
1
- export declare function isPlainObject(value: unknown): value is object;
2
- //# sourceMappingURL=is-plain-object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-plain-object.d.ts","sourceRoot":"","sources":["../../src/lib/is-plain-object.ts"],"names":[],"mappings":"AA6BA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAa7D"}
@@ -1,38 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- /*
5
- MIT License
6
-
7
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy of
10
- this software and associated documentation files (the "Software"), to deal in
11
- the Software without restriction, including without limitation the rights to
12
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13
- the Software, and to permit persons to whom the Software is furnished to do so,
14
- subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
- */
26
- // Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
27
- export function isPlainObject(value) {
28
- if (typeof value !== "object" || value === null) {
29
- return false;
30
- }
31
- const prototype = Object.getPrototypeOf(value);
32
- return ((prototype === null ||
33
- prototype === Object.prototype ||
34
- Object.getPrototypeOf(prototype) === null) &&
35
- !(Symbol.toStringTag in value) &&
36
- !(Symbol.iterator in value));
37
- }
38
- //# sourceMappingURL=is-plain-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../../src/lib/is-plain-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,iHAAiH;AAEjH,MAAM,UAAU,aAAa,CAAC,KAAc,EAAmB;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,CACL,CAAC,SAAS,KAAK,IAAI;QACjB,SAAS,KAAK,MAAM,CAAC,SAAS;QAC9B,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;QAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,CAC5B,CAAC;AAAA,CACH"}
package/src/lib/dlv.ts DELETED
@@ -1,53 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- /*
6
- MIT License
7
-
8
- Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy of
11
- this software and associated documentation files (the "Software"), to deal in
12
- the Software without restriction, including without limitation the rights to
13
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14
- the Software, and to permit persons to whom the Software is furnished to do so,
15
- subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
- */
27
-
28
- /**
29
- * @param obj The object to walk
30
- * @param key The key path to walk the object with
31
- * @param def A default value to return if the result is undefined
32
- *
33
- * @example
34
- * dlv(obj, "a.b.c.d")
35
- * @example
36
- * dlv(object, ["a", "b", "c", "d"])
37
- * @example
38
- * dlv(object, "foo.bar.baz", "Hello, default value!")
39
- */
40
- export function dlv<T = any>(
41
- obj: any,
42
- key: string | string[],
43
- def?: T,
44
- p?: number,
45
- undef?: never,
46
- ): T | undefined {
47
- key = Array.isArray(key) ? key : key.split(".");
48
- for (p = 0; p < key.length; p++) {
49
- const k = key[p];
50
- obj = k != null && obj ? obj[k] : undef;
51
- }
52
- return obj === undef ? def : obj;
53
- }
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- /*
6
- MIT License
7
-
8
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy of
11
- this software and associated documentation files (the "Software"), to deal in
12
- the Software without restriction, including without limitation the rights to
13
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14
- the Software, and to permit persons to whom the Software is furnished to do so,
15
- subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
- */
27
-
28
- // Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
29
-
30
- export function isPlainObject(value: unknown): value is object {
31
- if (typeof value !== "object" || value === null) {
32
- return false;
33
- }
34
-
35
- const prototype = Object.getPrototypeOf(value);
36
- return (
37
- (prototype === null ||
38
- prototype === Object.prototype ||
39
- Object.getPrototypeOf(prototype) === null) &&
40
- !(Symbol.toStringTag in value) &&
41
- !(Symbol.iterator in value)
42
- );
43
- }