@clientcasa/sdk 0.6.0 → 0.6.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 (70) hide show
  1. package/README.md +5 -0
  2. package/esm/funcs/inquiries-create.d.ts +16 -0
  3. package/esm/funcs/inquiries-create.d.ts.map +1 -0
  4. package/esm/funcs/inquiries-create.js +93 -0
  5. package/esm/funcs/inquiries-create.js.map +1 -0
  6. package/esm/funcs/invoices-create.d.ts +1 -1
  7. package/esm/funcs/invoices-create.js +1 -1
  8. package/esm/lib/config.d.ts +3 -3
  9. package/esm/lib/config.js +3 -3
  10. package/esm/models/form-submission.d.ts +1 -1
  11. package/esm/models/form-submission.d.ts.map +1 -1
  12. package/esm/models/form-submission.js +1 -1
  13. package/esm/models/form-submission.js.map +1 -1
  14. package/esm/models/index.d.ts +2 -0
  15. package/esm/models/index.d.ts.map +1 -1
  16. package/esm/models/index.js +2 -0
  17. package/esm/models/index.js.map +1 -1
  18. package/esm/models/inquiry-create.d.ts +32 -0
  19. package/esm/models/inquiry-create.d.ts.map +1 -0
  20. package/esm/models/inquiry-create.js +23 -0
  21. package/esm/models/inquiry-create.js.map +1 -0
  22. package/esm/models/inquiry.d.ts +33 -0
  23. package/esm/models/inquiry.d.ts.map +1 -0
  24. package/esm/models/inquiry.js +23 -0
  25. package/esm/models/inquiry.js.map +1 -0
  26. package/esm/models/invoice-update.d.ts +0 -1
  27. package/esm/models/invoice-update.d.ts.map +1 -1
  28. package/esm/models/invoice-update.js +0 -1
  29. package/esm/models/invoice-update.js.map +1 -1
  30. package/esm/models/invoice.d.ts +2 -2
  31. package/esm/models/invoice.js +1 -1
  32. package/esm/models/invoice.js.map +1 -1
  33. package/esm/models/operations/create-inquiry.d.ts +30 -0
  34. package/esm/models/operations/create-inquiry.d.ts.map +1 -0
  35. package/esm/models/operations/create-inquiry.js +27 -0
  36. package/esm/models/operations/create-inquiry.js.map +1 -0
  37. package/esm/models/operations/index.d.ts +1 -0
  38. package/esm/models/operations/index.d.ts.map +1 -1
  39. package/esm/models/operations/index.js +1 -0
  40. package/esm/models/operations/index.js.map +1 -1
  41. package/esm/models/operations/list-invoices.d.ts +4 -4
  42. package/esm/models/operations/list-invoices.js +2 -2
  43. package/esm/models/operations/list-invoices.js.map +1 -1
  44. package/esm/sdk/inquiries.d.ts +10 -0
  45. package/esm/sdk/inquiries.d.ts.map +1 -0
  46. package/esm/sdk/inquiries.js +15 -0
  47. package/esm/sdk/inquiries.js.map +1 -0
  48. package/esm/sdk/invoices.d.ts +1 -1
  49. package/esm/sdk/invoices.js +1 -1
  50. package/esm/sdk/sdk.d.ts +3 -0
  51. package/esm/sdk/sdk.d.ts.map +1 -1
  52. package/esm/sdk/sdk.js +5 -0
  53. package/esm/sdk/sdk.js.map +1 -1
  54. package/jsr.json +1 -1
  55. package/package.json +1 -1
  56. package/src/funcs/inquiries-create.ts +192 -0
  57. package/src/funcs/invoices-create.ts +1 -1
  58. package/src/lib/config.ts +3 -3
  59. package/src/models/form-submission.ts +2 -2
  60. package/src/models/index.ts +2 -0
  61. package/src/models/inquiry-create.ts +57 -0
  62. package/src/models/inquiry.ts +58 -0
  63. package/src/models/invoice-update.ts +0 -1
  64. package/src/models/invoice.ts +2 -2
  65. package/src/models/operations/create-inquiry.ts +73 -0
  66. package/src/models/operations/index.ts +1 -0
  67. package/src/models/operations/list-invoices.ts +4 -4
  68. package/src/sdk/inquiries.ts +27 -0
  69. package/src/sdk/invoices.ts +1 -1
  70. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,73 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as models from "../index.js";
8
+
9
+ export type CreateInquirySecurity = {
10
+ apiKey?: string | undefined;
11
+ bearer?: string | undefined;
12
+ };
13
+
14
+ export type CreateInquiryRequest = {
15
+ /**
16
+ * Optional unique key that makes this create safely retryable. Replaying the same key returns the original response instead of creating a duplicate; reusing a key with a different request body returns 409.
17
+ */
18
+ idempotencyKey?: string | undefined;
19
+ body: models.InquiryCreate;
20
+ };
21
+
22
+ /** @internal */
23
+ export type CreateInquirySecurity$Outbound = {
24
+ apiKey?: string | undefined;
25
+ bearer?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const CreateInquirySecurity$outboundSchema: z.ZodMiniType<
30
+ CreateInquirySecurity$Outbound,
31
+ CreateInquirySecurity
32
+ > = z.object({
33
+ apiKey: z.optional(z.string()),
34
+ bearer: z.optional(z.string()),
35
+ });
36
+
37
+ export function createInquirySecurityToJSON(
38
+ createInquirySecurity: CreateInquirySecurity,
39
+ ): string {
40
+ return JSON.stringify(
41
+ CreateInquirySecurity$outboundSchema.parse(createInquirySecurity),
42
+ );
43
+ }
44
+
45
+ /** @internal */
46
+ export type CreateInquiryRequest$Outbound = {
47
+ "Idempotency-Key"?: string | undefined;
48
+ body: models.InquiryCreate$Outbound;
49
+ };
50
+
51
+ /** @internal */
52
+ export const CreateInquiryRequest$outboundSchema: z.ZodMiniType<
53
+ CreateInquiryRequest$Outbound,
54
+ CreateInquiryRequest
55
+ > = z.pipe(
56
+ z.object({
57
+ idempotencyKey: z.optional(z.string()),
58
+ body: models.InquiryCreate$outboundSchema,
59
+ }),
60
+ z.transform((v) => {
61
+ return remap$(v, {
62
+ idempotencyKey: "Idempotency-Key",
63
+ });
64
+ }),
65
+ );
66
+
67
+ export function createInquiryRequestToJSON(
68
+ createInquiryRequest: CreateInquiryRequest,
69
+ ): string {
70
+ return JSON.stringify(
71
+ CreateInquiryRequest$outboundSchema.parse(createInquiryRequest),
72
+ );
73
+ }
@@ -9,6 +9,7 @@ export * from "./create-contact.js";
9
9
  export * from "./create-contract.js";
10
10
  export * from "./create-event-day-vendor.js";
11
11
  export * from "./create-event-day.js";
12
+ export * from "./create-inquiry.js";
12
13
  export * from "./create-invoice.js";
13
14
  export * from "./create-milestone.js";
14
15
  export * from "./create-payment.js";
@@ -18,21 +18,21 @@ export type ListInvoicesSecurity = {
18
18
  export const ListInvoicesStatus = {
19
19
  Draft: "draft",
20
20
  Sent: "sent",
21
- Partial: "partial",
22
21
  Paid: "paid",
23
22
  Void: "void",
23
+ WrittenOff: "written_off",
24
24
  } as const;
25
25
  export type ListInvoicesStatus = ClosedEnum<typeof ListInvoicesStatus>;
26
26
 
27
27
  /**
28
- * Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
28
+ * Filter by the derived overdue condition. `true` → open (`sent`) invoices past their due date with a balance owing; `false` → everything else.
29
29
  */
30
30
  export const Overdue = {
31
31
  True: "true",
32
32
  False: "false",
33
33
  } as const;
34
34
  /**
35
- * Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
35
+ * Filter by the derived overdue condition. `true` → open (`sent`) invoices past their due date with a balance owing; `false` → everything else.
36
36
  */
37
37
  export type Overdue = ClosedEnum<typeof Overdue>;
38
38
 
@@ -45,7 +45,7 @@ export type ListInvoicesRequest = {
45
45
  clientId?: string | undefined;
46
46
  status?: ListInvoicesStatus | undefined;
47
47
  /**
48
- * Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
48
+ * Filter by the derived overdue condition. `true` → open (`sent`) invoices past their due date with a balance owing; `false` → everything else.
49
49
  */
50
50
  overdue?: Overdue | undefined;
51
51
  /**
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { inquiriesCreate } from "../funcs/inquiries-create.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as models from "../models/index.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { unwrapAsync } from "../types/fp.js";
10
+
11
+ export class Inquiries extends ClientSDK {
12
+ /**
13
+ * Submit an inquiry (capture a lead)
14
+ */
15
+ async create(
16
+ security: operations.CreateInquirySecurity,
17
+ request: operations.CreateInquiryRequest,
18
+ options?: RequestOptions,
19
+ ): Promise<models.Inquiry> {
20
+ return unwrapAsync(inquiriesCreate(
21
+ this,
22
+ security,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
@@ -34,7 +34,7 @@ export class Invoices extends ClientSDK {
34
34
  * Create an invoice
35
35
  *
36
36
  * @remarks
37
- * Status `paid` and `partial` are system-derived from Payments; do not set them directly. `overdue` is not a status — it is a derived read-only boolean field (past due with a balance owing).
37
+ * Status is system-derived: `paid` comes from Payments and there is no `partial` (partial-ness is numeric via amountPaid/balanceDue). `overdue` is not a status — it is a derived read-only boolean (past due with a balance owing).
38
38
  */
39
39
  async create(
40
40
  security: operations.CreateInvoiceSecurity,
package/src/sdk/sdk.ts CHANGED
@@ -14,6 +14,7 @@ import { EventDays } from "./event-days.js";
14
14
  import { FormSubmissions } from "./form-submissions.js";
15
15
  import { FormsAndAgreements } from "./forms-and-agreements.js";
16
16
  import { Forms } from "./forms.js";
17
+ import { Inquiries } from "./inquiries.js";
17
18
  import { Invoices } from "./invoices.js";
18
19
  import { Milestones } from "./milestones.js";
19
20
  import { Payments } from "./payments.js";
@@ -71,6 +72,11 @@ export class ClientCasa extends ClientSDK {
71
72
  return (this._formSubmissions ??= new FormSubmissions(this._options));
72
73
  }
73
74
 
75
+ private _inquiries?: Inquiries;
76
+ get inquiries(): Inquiries {
77
+ return (this._inquiries ??= new Inquiries(this._options));
78
+ }
79
+
74
80
  private _payments?: Payments;
75
81
  get payments(): Payments {
76
82
  return (this._payments ??= new Payments(this._options));