@clientcasa/sdk 0.6.5 → 0.7.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 (104) hide show
  1. package/esm/funcs/transactions-create.d.ts +3 -0
  2. package/esm/funcs/transactions-create.d.ts.map +1 -1
  3. package/esm/funcs/transactions-create.js +3 -0
  4. package/esm/funcs/transactions-create.js.map +1 -1
  5. package/esm/funcs/transactions-update.d.ts +1 -1
  6. package/esm/funcs/transactions-update.js +1 -1
  7. package/esm/lib/config.d.ts +3 -3
  8. package/esm/lib/config.js +3 -3
  9. package/esm/lib/config.js.map +1 -1
  10. package/esm/lib/encodings.d.ts +10 -9
  11. package/esm/lib/encodings.d.ts.map +1 -1
  12. package/esm/lib/encodings.js +29 -13
  13. package/esm/lib/encodings.js.map +1 -1
  14. package/esm/models/api-error.d.ts +25 -3
  15. package/esm/models/api-error.d.ts.map +1 -1
  16. package/esm/models/api-error.js +25 -1
  17. package/esm/models/api-error.js.map +1 -1
  18. package/esm/models/catalog-item-create.d.ts +5 -0
  19. package/esm/models/catalog-item-create.d.ts.map +1 -1
  20. package/esm/models/catalog-item-create.js +1 -0
  21. package/esm/models/catalog-item-create.js.map +1 -1
  22. package/esm/models/catalog-item-update.d.ts +4 -4
  23. package/esm/models/catalog-item-update.d.ts.map +1 -1
  24. package/esm/models/catalog-item-update.js +4 -4
  25. package/esm/models/catalog-item-update.js.map +1 -1
  26. package/esm/models/catalog-item.d.ts +4 -0
  27. package/esm/models/catalog-item.d.ts.map +1 -1
  28. package/esm/models/catalog-item.js +1 -0
  29. package/esm/models/catalog-item.js.map +1 -1
  30. package/esm/models/client-create.d.ts +5 -0
  31. package/esm/models/client-create.d.ts.map +1 -1
  32. package/esm/models/client-create.js +1 -0
  33. package/esm/models/client-create.js.map +1 -1
  34. package/esm/models/client-update.d.ts +1 -1
  35. package/esm/models/client-update.d.ts.map +1 -1
  36. package/esm/models/client-update.js +1 -1
  37. package/esm/models/client-update.js.map +1 -1
  38. package/esm/models/client.d.ts +4 -0
  39. package/esm/models/client.d.ts.map +1 -1
  40. package/esm/models/client.js +1 -0
  41. package/esm/models/client.js.map +1 -1
  42. package/esm/models/contact-update.d.ts +2 -2
  43. package/esm/models/contact-update.d.ts.map +1 -1
  44. package/esm/models/contact-update.js +2 -2
  45. package/esm/models/contact-update.js.map +1 -1
  46. package/esm/models/payment.d.ts +1 -1
  47. package/esm/models/payment.d.ts.map +1 -1
  48. package/esm/models/payment.js +1 -1
  49. package/esm/models/payment.js.map +1 -1
  50. package/esm/models/project-update.d.ts +1 -1
  51. package/esm/models/project-update.d.ts.map +1 -1
  52. package/esm/models/project-update.js +1 -1
  53. package/esm/models/project-update.js.map +1 -1
  54. package/esm/models/project.d.ts +5 -1
  55. package/esm/models/project.d.ts.map +1 -1
  56. package/esm/models/project.js +2 -1
  57. package/esm/models/project.js.map +1 -1
  58. package/esm/models/time-entry-update.d.ts +2 -2
  59. package/esm/models/time-entry-update.d.ts.map +1 -1
  60. package/esm/models/time-entry-update.js +2 -2
  61. package/esm/models/time-entry-update.js.map +1 -1
  62. package/esm/models/time-entry.d.ts +3 -3
  63. package/esm/models/time-entry.d.ts.map +1 -1
  64. package/esm/models/time-entry.js +3 -3
  65. package/esm/models/time-entry.js.map +1 -1
  66. package/esm/models/transaction-create.d.ts +5 -0
  67. package/esm/models/transaction-create.d.ts.map +1 -1
  68. package/esm/models/transaction-create.js +1 -0
  69. package/esm/models/transaction-create.js.map +1 -1
  70. package/esm/models/transaction-update.d.ts +3 -3
  71. package/esm/models/transaction-update.d.ts.map +1 -1
  72. package/esm/models/transaction-update.js +3 -3
  73. package/esm/models/transaction-update.js.map +1 -1
  74. package/esm/models/transaction.d.ts +4 -0
  75. package/esm/models/transaction.d.ts.map +1 -1
  76. package/esm/models/transaction.js +1 -0
  77. package/esm/models/transaction.js.map +1 -1
  78. package/esm/sdk/transactions.d.ts +4 -1
  79. package/esm/sdk/transactions.d.ts.map +1 -1
  80. package/esm/sdk/transactions.js +4 -1
  81. package/esm/sdk/transactions.js.map +1 -1
  82. package/jsr.json +1 -1
  83. package/package.json +2 -2
  84. package/src/funcs/transactions-create.ts +3 -0
  85. package/src/funcs/transactions-update.ts +1 -1
  86. package/src/lib/config.ts +3 -3
  87. package/src/lib/encodings.ts +58 -23
  88. package/src/models/api-error.ts +46 -2
  89. package/src/models/catalog-item-create.ts +6 -0
  90. package/src/models/catalog-item-update.ts +8 -9
  91. package/src/models/catalog-item.ts +5 -0
  92. package/src/models/client-create.ts +6 -0
  93. package/src/models/client-update.ts +2 -2
  94. package/src/models/client.ts +5 -0
  95. package/src/models/contact-update.ts +4 -4
  96. package/src/models/payment.ts +2 -2
  97. package/src/models/project-update.ts +2 -2
  98. package/src/models/project.ts +7 -2
  99. package/src/models/time-entry-update.ts +4 -4
  100. package/src/models/time-entry.ts +6 -6
  101. package/src/models/transaction-create.ts +6 -0
  102. package/src/models/transaction-update.ts +6 -6
  103. package/src/models/transaction.ts +5 -0
  104. package/src/sdk/transactions.ts +4 -1
@@ -36,8 +36,8 @@ export type ContactUpdate$Outbound = {
36
36
  email?: string | undefined;
37
37
  phone?: string | undefined;
38
38
  title?: string | undefined;
39
- role: string;
40
- isPrimary: boolean;
39
+ role?: string | undefined;
40
+ isPrimary?: boolean | undefined;
41
41
  clientId?: string | undefined;
42
42
  };
43
43
 
@@ -50,8 +50,8 @@ export const ContactUpdate$outboundSchema: z.ZodMiniType<
50
50
  email: z.optional(z.string()),
51
51
  phone: z.optional(z.string()),
52
52
  title: z.optional(z.string()),
53
- role: z._default(ContactUpdateRole$outboundSchema, "other"),
54
- isPrimary: z._default(z.boolean(), false),
53
+ role: z.optional(ContactUpdateRole$outboundSchema),
54
+ isPrimary: z.optional(z.boolean()),
55
55
  clientId: z.optional(z.string()),
56
56
  });
57
57
 
@@ -48,7 +48,7 @@ export type Payment = {
48
48
  /**
49
49
  * UUID v4
50
50
  */
51
- clientId: string;
51
+ clientId: string | null;
52
52
  /**
53
53
  * UUID v4
54
54
  */
@@ -99,7 +99,7 @@ export const PaymentKind$inboundSchema: z.ZodMiniType<PaymentKind, unknown> =
99
99
  /** @internal */
100
100
  export const Payment$inboundSchema: z.ZodMiniType<Payment, unknown> = z.object({
101
101
  id: types.string(),
102
- clientId: types.string(),
102
+ clientId: types.nullable(types.string()),
103
103
  invoiceId: types.nullable(types.string()),
104
104
  amount: types.number(),
105
105
  currency: types.string(),
@@ -38,7 +38,7 @@ export const ProjectUpdateStatus$outboundSchema: z.ZodMiniEnum<
38
38
  export type ProjectUpdate$Outbound = {
39
39
  name?: string | undefined;
40
40
  clientId?: string | undefined;
41
- status: string;
41
+ status?: string | undefined;
42
42
  pipelineStageId?: string | undefined;
43
43
  startDate?: string | undefined;
44
44
  endDate?: string | undefined;
@@ -53,7 +53,7 @@ export const ProjectUpdate$outboundSchema: z.ZodMiniType<
53
53
  > = z.object({
54
54
  name: z.optional(z.string()),
55
55
  clientId: z.optional(z.string()),
56
- status: z._default(ProjectUpdateStatus$outboundSchema, "active"),
56
+ status: z.optional(ProjectUpdateStatus$outboundSchema),
57
57
  pipelineStageId: z.optional(z.string()),
58
58
  startDate: z.optional(
59
59
  z.pipe(
@@ -26,7 +26,11 @@ export type Project = {
26
26
  /**
27
27
  * UUID v4
28
28
  */
29
- clientId: string;
29
+ clientId: string | null;
30
+ /**
31
+ * UUID v4
32
+ */
33
+ businessId: string;
30
34
  status: ProjectStatus;
31
35
  /**
32
36
  * UUID v4
@@ -56,7 +60,8 @@ export const ProjectStatus$inboundSchema: z.ZodMiniType<
56
60
  export const Project$inboundSchema: z.ZodMiniType<Project, unknown> = z.object({
57
61
  id: types.string(),
58
62
  name: types.string(),
59
- clientId: types.string(),
63
+ clientId: types.nullable(types.string()),
64
+ businessId: types.string(),
60
65
  status: ProjectStatus$inboundSchema,
61
66
  pipelineStageId: types.nullable(types.string()),
62
67
  startDate: types.nullable(types.date()),
@@ -51,8 +51,8 @@ export type TimeEntryUpdate$Outbound = {
51
51
  date?: string | undefined;
52
52
  hours?: number | undefined;
53
53
  description?: string | undefined;
54
- billable: boolean;
55
- rateType: string;
54
+ billable?: boolean | undefined;
55
+ rateType?: string | undefined;
56
56
  customMultiplierName?: string | undefined;
57
57
  rateOverride?: number | undefined;
58
58
  workerName?: string | undefined;
@@ -74,8 +74,8 @@ export const TimeEntryUpdate$outboundSchema: z.ZodMiniType<
74
74
  ),
75
75
  hours: z.optional(z.number()),
76
76
  description: z.optional(z.string()),
77
- billable: z._default(z.boolean(), true),
78
- rateType: z._default(TimeEntryUpdateRateType$outboundSchema, "standard"),
77
+ billable: z.optional(z.boolean()),
78
+ rateType: z.optional(TimeEntryUpdateRateType$outboundSchema),
79
79
  customMultiplierName: z.optional(z.string()),
80
80
  rateOverride: z.optional(z.number()),
81
81
  workerName: z.optional(z.string()),
@@ -26,15 +26,15 @@ export type TimeEntry = {
26
26
  /**
27
27
  * UUID v4
28
28
  */
29
- projectId: string;
29
+ projectId: string | null;
30
30
  /**
31
31
  * UUID v4
32
32
  */
33
- clientId: string;
33
+ clientId: string | null;
34
34
  /**
35
35
  * UUID v4
36
36
  */
37
- memberId: string;
37
+ memberId: string | null;
38
38
  /**
39
39
  * UUID v4
40
40
  */
@@ -68,9 +68,9 @@ export const TimeEntryRateType$inboundSchema: z.ZodMiniType<
68
68
  export const TimeEntry$inboundSchema: z.ZodMiniType<TimeEntry, unknown> = z
69
69
  .object({
70
70
  id: types.string(),
71
- projectId: types.string(),
72
- clientId: types.string(),
73
- memberId: types.string(),
71
+ projectId: types.nullable(types.string()),
72
+ clientId: types.nullable(types.string()),
73
+ memberId: types.nullable(types.string()),
74
74
  catalogItemId: types.nullable(types.string()),
75
75
  date: types.date(),
76
76
  hours: types.number(),
@@ -57,6 +57,10 @@ export type TransactionCreateStatus = ClosedEnum<
57
57
 
58
58
  export type TransactionCreate = {
59
59
  name: string;
60
+ /**
61
+ * UUID v4
62
+ */
63
+ businessId?: string | undefined;
60
64
  /**
61
65
  * UUID v4
62
66
  */
@@ -150,6 +154,7 @@ export const TransactionCreateStatus$outboundSchema: z.ZodMiniEnum<
150
154
  /** @internal */
151
155
  export type TransactionCreate$Outbound = {
152
156
  name: string;
157
+ businessId?: string | undefined;
153
158
  catalogItemId?: string | undefined;
154
159
  taxCategoryId?: string | undefined;
155
160
  amount: number;
@@ -175,6 +180,7 @@ export const TransactionCreate$outboundSchema: z.ZodMiniType<
175
180
  TransactionCreate
176
181
  > = z.object({
177
182
  name: z.string(),
183
+ businessId: z.optional(z.string()),
178
184
  catalogItemId: z.optional(z.string()),
179
185
  taxCategoryId: z.optional(z.string()),
180
186
  amount: z.number(),
@@ -153,9 +153,9 @@ export type TransactionUpdate$Outbound = {
153
153
  catalogItemId?: string | undefined;
154
154
  taxCategoryId?: string | undefined;
155
155
  amount?: number | undefined;
156
- frequency: string;
156
+ frequency?: string | undefined;
157
157
  direction?: string | undefined;
158
- mode: string;
158
+ mode?: string | undefined;
159
159
  splitEvenly?: boolean | undefined;
160
160
  assignments?: Array<TransactionUpdateAssignment$Outbound> | undefined;
161
161
  passThrough?: boolean | undefined;
@@ -166,7 +166,7 @@ export type TransactionUpdate$Outbound = {
166
166
  vendorName?: string | undefined;
167
167
  vendorEmail?: string | undefined;
168
168
  vendorTaxId?: string | undefined;
169
- status: string;
169
+ status?: string | undefined;
170
170
  };
171
171
 
172
172
  /** @internal */
@@ -178,9 +178,9 @@ export const TransactionUpdate$outboundSchema: z.ZodMiniType<
178
178
  catalogItemId: z.optional(z.string()),
179
179
  taxCategoryId: z.optional(z.string()),
180
180
  amount: z.optional(z.number()),
181
- frequency: z._default(TransactionUpdateFrequency$outboundSchema, "one-time"),
181
+ frequency: z.optional(TransactionUpdateFrequency$outboundSchema),
182
182
  direction: z.optional(TransactionUpdateDirection$outboundSchema),
183
- mode: z._default(TransactionUpdateMode$outboundSchema, "each"),
183
+ mode: z.optional(TransactionUpdateMode$outboundSchema),
184
184
  splitEvenly: z.optional(z.boolean()),
185
185
  assignments: z.optional(
186
186
  z.array(z.lazy(() => TransactionUpdateAssignment$outboundSchema)),
@@ -203,7 +203,7 @@ export const TransactionUpdate$outboundSchema: z.ZodMiniType<
203
203
  vendorName: z.optional(z.string()),
204
204
  vendorEmail: z.optional(z.string()),
205
205
  vendorTaxId: z.optional(z.string()),
206
- status: z._default(TransactionUpdateStatus$outboundSchema, "active"),
206
+ status: z.optional(TransactionUpdateStatus$outboundSchema),
207
207
  });
208
208
 
209
209
  export function transactionUpdateToJSON(
@@ -60,6 +60,10 @@ export type Transaction = {
60
60
  */
61
61
  id: string;
62
62
  name: string;
63
+ /**
64
+ * UUID v4
65
+ */
66
+ businessId: string;
63
67
  /**
64
68
  * UUID v4
65
69
  */
@@ -148,6 +152,7 @@ export const Transaction$inboundSchema: z.ZodMiniType<Transaction, unknown> = z
148
152
  .object({
149
153
  id: types.string(),
150
154
  name: types.string(),
155
+ businessId: types.string(),
151
156
  catalogItemId: types.nullable(types.string()),
152
157
  taxCategoryId: types.nullable(types.string()),
153
158
  amount: types.nullable(types.number()),
@@ -34,6 +34,9 @@ export class Transactions extends ClientSDK {
34
34
 
35
35
  /**
36
36
  * Create a transaction (expense or charge)
37
+ *
38
+ * @remarks
39
+ * A `global` transaction applies org-wide (all clients for revenue, overhead for cost), so it cannot carry `assignments` — send an empty array, or use mode `each`/`split` to scope it. This constraint is enforced by the server but cannot be expressed in JSON Schema, so generated SDKs will surface it as a 400 rather than a compile error.
37
40
  */
38
41
  async create(
39
42
  security: operations.CreateTransactionSecurity,
@@ -87,7 +90,7 @@ export class Transactions extends ClientSDK {
87
90
  * Update a transaction
88
91
  *
89
92
  * @remarks
90
- * Transactions billed to a sent/paid invoice may be frozen — the server will return 409 if so.
93
+ * Transactions billed to a sent/paid invoice may be frozen — the server will return 409 if so. A `global` transaction applies org-wide (all clients for revenue, overhead for cost), so it cannot carry `assignments` — send an empty array, or use mode `each`/`split` to scope it. This constraint is enforced by the server but cannot be expressed in JSON Schema, so generated SDKs will surface it as a 400 rather than a compile error.
91
94
  */
92
95
  async update(
93
96
  security: operations.UpdateTransactionSecurity,