@clientcasa/sdk 0.7.0 → 0.7.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 (95) hide show
  1. package/README.md +7 -0
  2. package/esm/funcs/payments-list.js +1 -0
  3. package/esm/funcs/payments-list.js.map +1 -1
  4. package/esm/funcs/sales-get.d.ts +16 -0
  5. package/esm/funcs/sales-get.d.ts.map +1 -0
  6. package/esm/funcs/sales-get.js +107 -0
  7. package/esm/funcs/sales-get.js.map +1 -0
  8. package/esm/funcs/sales-list.d.ts +18 -0
  9. package/esm/funcs/sales-list.d.ts.map +1 -0
  10. package/esm/funcs/sales-list.js +141 -0
  11. package/esm/funcs/sales-list.js.map +1 -0
  12. package/esm/lib/config.d.ts +3 -3
  13. package/esm/lib/config.js +3 -3
  14. package/esm/lib/config.js.map +1 -1
  15. package/esm/models/api-error.d.ts +1 -0
  16. package/esm/models/api-error.d.ts.map +1 -1
  17. package/esm/models/api-error.js +1 -0
  18. package/esm/models/api-error.js.map +1 -1
  19. package/esm/models/index.d.ts +2 -0
  20. package/esm/models/index.d.ts.map +1 -1
  21. package/esm/models/index.js +2 -0
  22. package/esm/models/index.js.map +1 -1
  23. package/esm/models/operations/get-sale.d.ts +27 -0
  24. package/esm/models/operations/get-sale.d.ts.map +1 -0
  25. package/esm/models/operations/get-sale.js +20 -0
  26. package/esm/models/operations/get-sale.js.map +1 -0
  27. package/esm/models/operations/index.d.ts +2 -0
  28. package/esm/models/operations/index.d.ts.map +1 -1
  29. package/esm/models/operations/index.js +2 -0
  30. package/esm/models/operations/index.js.map +1 -1
  31. package/esm/models/operations/list-payments.d.ts +5 -0
  32. package/esm/models/operations/list-payments.d.ts.map +1 -1
  33. package/esm/models/operations/list-payments.js +1 -0
  34. package/esm/models/operations/list-payments.js.map +1 -1
  35. package/esm/models/operations/list-sales.d.ts +75 -0
  36. package/esm/models/operations/list-sales.d.ts.map +1 -0
  37. package/esm/models/operations/list-sales.js +60 -0
  38. package/esm/models/operations/list-sales.js.map +1 -0
  39. package/esm/models/operations/list-webhooks.d.ts +15 -2
  40. package/esm/models/operations/list-webhooks.d.ts.map +1 -1
  41. package/esm/models/operations/list-webhooks.js +15 -2
  42. package/esm/models/operations/list-webhooks.js.map +1 -1
  43. package/esm/models/payment.d.ts +4 -0
  44. package/esm/models/payment.d.ts.map +1 -1
  45. package/esm/models/payment.js +1 -0
  46. package/esm/models/payment.js.map +1 -1
  47. package/esm/models/sale-list.d.ts +13 -0
  48. package/esm/models/sale-list.d.ts.map +1 -0
  49. package/esm/models/sale-list.js +17 -0
  50. package/esm/models/sale-list.js.map +1 -0
  51. package/esm/models/sale.d.ts +76 -0
  52. package/esm/models/sale.d.ts.map +1 -0
  53. package/esm/models/sale.js +58 -0
  54. package/esm/models/sale.js.map +1 -0
  55. package/esm/models/webhook-create.d.ts +15 -2
  56. package/esm/models/webhook-create.d.ts.map +1 -1
  57. package/esm/models/webhook-create.js +15 -2
  58. package/esm/models/webhook-create.js.map +1 -1
  59. package/esm/models/webhook-update.d.ts +15 -2
  60. package/esm/models/webhook-update.d.ts.map +1 -1
  61. package/esm/models/webhook-update.js +15 -2
  62. package/esm/models/webhook-update.js.map +1 -1
  63. package/esm/models/webhook.d.ts +15 -2
  64. package/esm/models/webhook.d.ts.map +1 -1
  65. package/esm/models/webhook.js +15 -2
  66. package/esm/models/webhook.js.map +1 -1
  67. package/esm/sdk/sales.d.ts +17 -0
  68. package/esm/sdk/sales.d.ts.map +1 -0
  69. package/esm/sdk/sales.js +23 -0
  70. package/esm/sdk/sales.js.map +1 -0
  71. package/esm/sdk/sdk.d.ts +3 -0
  72. package/esm/sdk/sdk.d.ts.map +1 -1
  73. package/esm/sdk/sdk.js +5 -0
  74. package/esm/sdk/sdk.js.map +1 -1
  75. package/jsr.json +1 -1
  76. package/package.json +1 -1
  77. package/src/funcs/payments-list.ts +1 -0
  78. package/src/funcs/sales-get.ts +202 -0
  79. package/src/funcs/sales-list.ts +277 -0
  80. package/src/lib/config.ts +3 -3
  81. package/src/models/api-error.ts +1 -0
  82. package/src/models/index.ts +2 -0
  83. package/src/models/operations/get-sale.ts +55 -0
  84. package/src/models/operations/index.ts +2 -0
  85. package/src/models/operations/list-payments.ts +6 -0
  86. package/src/models/operations/list-sales.ts +159 -0
  87. package/src/models/operations/list-webhooks.ts +15 -2
  88. package/src/models/payment.ts +5 -0
  89. package/src/models/sale-list.ts +35 -0
  90. package/src/models/sale.ts +124 -0
  91. package/src/models/webhook-create.ts +15 -2
  92. package/src/models/webhook-update.ts +15 -2
  93. package/src/models/webhook.ts +15 -2
  94. package/src/sdk/sales.ts +45 -0
  95. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,159 @@
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 { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
11
+ import * as models from "../index.js";
12
+
13
+ export type ListSalesSecurity = {
14
+ apiKey?: string | undefined;
15
+ bearer?: string | undefined;
16
+ };
17
+
18
+ export const ListSalesStatus = {
19
+ Completed: "completed",
20
+ Refunded: "refunded",
21
+ PartiallyRefunded: "partially-refunded",
22
+ Voided: "voided",
23
+ } as const;
24
+ export type ListSalesStatus = ClosedEnum<typeof ListSalesStatus>;
25
+
26
+ export const Channel = {
27
+ Pos: "pos",
28
+ Manual: "manual",
29
+ Stripe: "stripe",
30
+ Shopify: "shopify",
31
+ Etsy: "etsy",
32
+ SquareImport: "square-import",
33
+ Api: "api",
34
+ } as const;
35
+ export type Channel = ClosedEnum<typeof Channel>;
36
+
37
+ export type ListSalesRequest = {
38
+ page?: number | undefined;
39
+ pageSize?: number | undefined;
40
+ status?: ListSalesStatus | undefined;
41
+ channel?: Channel | undefined;
42
+ /**
43
+ * UUID v4
44
+ */
45
+ clientId?: string | undefined;
46
+ /**
47
+ * UUID v4
48
+ */
49
+ businessId?: string | undefined;
50
+ saleDateFrom?: Date | undefined;
51
+ saleDateTo?: Date | undefined;
52
+ };
53
+
54
+ export type ListSalesResponse = {
55
+ result: models.SaleList;
56
+ };
57
+
58
+ /** @internal */
59
+ export type ListSalesSecurity$Outbound = {
60
+ apiKey?: string | undefined;
61
+ bearer?: string | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const ListSalesSecurity$outboundSchema: z.ZodMiniType<
66
+ ListSalesSecurity$Outbound,
67
+ ListSalesSecurity
68
+ > = z.object({
69
+ apiKey: z.optional(z.string()),
70
+ bearer: z.optional(z.string()),
71
+ });
72
+
73
+ export function listSalesSecurityToJSON(
74
+ listSalesSecurity: ListSalesSecurity,
75
+ ): string {
76
+ return JSON.stringify(
77
+ ListSalesSecurity$outboundSchema.parse(listSalesSecurity),
78
+ );
79
+ }
80
+
81
+ /** @internal */
82
+ export const ListSalesStatus$outboundSchema: z.ZodMiniEnum<
83
+ typeof ListSalesStatus
84
+ > = z.enum(ListSalesStatus);
85
+
86
+ /** @internal */
87
+ export const Channel$outboundSchema: z.ZodMiniEnum<typeof Channel> = z.enum(
88
+ Channel,
89
+ );
90
+
91
+ /** @internal */
92
+ export type ListSalesRequest$Outbound = {
93
+ page: number;
94
+ pageSize: number;
95
+ status?: string | undefined;
96
+ channel?: string | undefined;
97
+ clientId?: string | undefined;
98
+ businessId?: string | undefined;
99
+ saleDateFrom?: string | undefined;
100
+ saleDateTo?: string | undefined;
101
+ };
102
+
103
+ /** @internal */
104
+ export const ListSalesRequest$outboundSchema: z.ZodMiniType<
105
+ ListSalesRequest$Outbound,
106
+ ListSalesRequest
107
+ > = z.object({
108
+ page: z._default(z.int(), 1),
109
+ pageSize: z._default(z.int(), 25),
110
+ status: z.optional(ListSalesStatus$outboundSchema),
111
+ channel: z.optional(Channel$outboundSchema),
112
+ clientId: z.optional(z.string()),
113
+ businessId: z.optional(z.string()),
114
+ saleDateFrom: z.optional(
115
+ z.pipe(
116
+ z.date(),
117
+ z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
118
+ ),
119
+ ),
120
+ saleDateTo: z.optional(
121
+ z.pipe(
122
+ z.date(),
123
+ z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
124
+ ),
125
+ ),
126
+ });
127
+
128
+ export function listSalesRequestToJSON(
129
+ listSalesRequest: ListSalesRequest,
130
+ ): string {
131
+ return JSON.stringify(
132
+ ListSalesRequest$outboundSchema.parse(listSalesRequest),
133
+ );
134
+ }
135
+
136
+ /** @internal */
137
+ export const ListSalesResponse$inboundSchema: z.ZodMiniType<
138
+ ListSalesResponse,
139
+ unknown
140
+ > = z.pipe(
141
+ z.object({
142
+ Result: models.SaleList$inboundSchema,
143
+ }),
144
+ z.transform((v) => {
145
+ return remap$(v, {
146
+ "Result": "result",
147
+ });
148
+ }),
149
+ );
150
+
151
+ export function listSalesResponseFromJSON(
152
+ jsonString: string,
153
+ ): SafeParseResult<ListSalesResponse, SDKValidationError> {
154
+ return safeParse(
155
+ jsonString,
156
+ (x) => ListSalesResponse$inboundSchema.parse(JSON.parse(x)),
157
+ `Failed to parse 'ListSalesResponse' from JSON`,
158
+ );
159
+ }
@@ -23,7 +23,6 @@ export const Event = {
23
23
  InvoicePaymentFailed: "invoice_payment_failed",
24
24
  InvoiceDisputed: "invoice_disputed",
25
25
  InvoicePaymentReminder: "invoice_payment_reminder",
26
- InvoiceViewed: "invoice_viewed",
27
26
  PaymentReceived: "payment_received",
28
27
  PaymentRefunded: "payment_refunded",
29
28
  PaymentApplied: "payment_applied",
@@ -48,6 +47,7 @@ export const Event = {
48
47
  ClientWon: "client_won",
49
48
  ClientLost: "client_lost",
50
49
  LeadStatusChanged: "lead_status_changed",
50
+ InvoiceViewed: "invoice_viewed",
51
51
  MilestoneApproaching: "milestone_approaching",
52
52
  TimerRunningReminder: "timer_running_reminder",
53
53
  ContractSent: "contract_sent",
@@ -58,12 +58,12 @@ export const Event = {
58
58
  ContractCompleted: "contract_completed",
59
59
  ContractExpired: "contract_expired",
60
60
  ContractVoided: "contract_voided",
61
+ FormSubmissionCompleted: "form_submission_completed",
61
62
  SmartFileSent: "smart_file_sent",
62
63
  SmartFileViewed: "smart_file_viewed",
63
64
  SmartFileAccepted: "smart_file_accepted",
64
65
  SmartFileCompleted: "smart_file_completed",
65
66
  SmartFileExpired: "smart_file_expired",
66
- FormSubmissionCompleted: "form_submission_completed",
67
67
  SubscriptionPaymentFailed: "subscription_payment_failed",
68
68
  PayoutPaid: "payout_paid",
69
69
  PayoutFailed: "payout_failed",
@@ -72,6 +72,19 @@ export const Event = {
72
72
  EventDayArchived: "event_day_archived",
73
73
  TimelineItemCompleted: "timeline_item_completed",
74
74
  TimelineReminderSent: "timeline_reminder_sent",
75
+ InvoiceRefunded: "invoice_refunded",
76
+ ContractAmended: "contract_amended",
77
+ ReceiptViewed: "receipt_viewed",
78
+ FollowUpDue: "follow_up_due",
79
+ PaymentProcessing: "payment_processing",
80
+ ClientReply: "client_reply",
81
+ ClientRevisionRequested: "client_revision_requested",
82
+ EmailDeliveryFailed: "email_delivery_failed",
83
+ SaleCompleted: "sale_completed",
84
+ SaleRefunded: "sale_refunded",
85
+ SaleVoided: "sale_voided",
86
+ SaleReceiptSent: "sale_receipt_sent",
87
+ SaleViewed: "sale_viewed",
75
88
  } as const;
76
89
  export type Event = ClosedEnum<typeof Event>;
77
90
 
@@ -53,6 +53,10 @@ export type Payment = {
53
53
  * UUID v4
54
54
  */
55
55
  invoiceId: string | null;
56
+ /**
57
+ * UUID v4
58
+ */
59
+ saleId: string | null;
56
60
  amount: number;
57
61
  currency: string;
58
62
  receivedDate: Date;
@@ -101,6 +105,7 @@ export const Payment$inboundSchema: z.ZodMiniType<Payment, unknown> = z.object({
101
105
  id: types.string(),
102
106
  clientId: types.nullable(types.string()),
103
107
  invoiceId: types.nullable(types.string()),
108
+ saleId: types.nullable(types.string()),
104
109
  amount: types.number(),
105
110
  currency: types.string(),
106
111
  receivedDate: types.date(),
@@ -0,0 +1,35 @@
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 { SDKValidationError } from "./errors/sdk-validation-error.js";
9
+ import {
10
+ PaginationMeta,
11
+ PaginationMeta$inboundSchema,
12
+ } from "./pagination-meta.js";
13
+ import { Sale, Sale$inboundSchema } from "./sale.js";
14
+
15
+ export type SaleList = {
16
+ data: Array<Sale>;
17
+ pagination: PaginationMeta;
18
+ };
19
+
20
+ /** @internal */
21
+ export const SaleList$inboundSchema: z.ZodMiniType<SaleList, unknown> = z
22
+ .object({
23
+ data: z.array(Sale$inboundSchema),
24
+ pagination: PaginationMeta$inboundSchema,
25
+ });
26
+
27
+ export function saleListFromJSON(
28
+ jsonString: string,
29
+ ): SafeParseResult<SaleList, SDKValidationError> {
30
+ return safeParse(
31
+ jsonString,
32
+ (x) => SaleList$inboundSchema.parse(JSON.parse(x)),
33
+ `Failed to parse 'SaleList' from JSON`,
34
+ );
35
+ }
@@ -0,0 +1,124 @@
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 * as openEnums from "../types/enums.js";
8
+ import { OpenEnum } from "../types/enums.js";
9
+ import { Result as SafeParseResult } from "../types/fp.js";
10
+ import * as types from "../types/primitives.js";
11
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
12
+
13
+ export const Channel = {
14
+ Pos: "pos",
15
+ Manual: "manual",
16
+ Stripe: "stripe",
17
+ Shopify: "shopify",
18
+ Etsy: "etsy",
19
+ SquareImport: "square-import",
20
+ Api: "api",
21
+ } as const;
22
+ export type Channel = OpenEnum<typeof Channel>;
23
+
24
+ export const SaleStatus = {
25
+ Completed: "completed",
26
+ Refunded: "refunded",
27
+ PartiallyRefunded: "partially-refunded",
28
+ Voided: "voided",
29
+ } as const;
30
+ export type SaleStatus = OpenEnum<typeof SaleStatus>;
31
+
32
+ export type Sale = {
33
+ /**
34
+ * UUID v4
35
+ */
36
+ id: string;
37
+ saleNumber: string;
38
+ /**
39
+ * UUID v4
40
+ */
41
+ businessId: string | null;
42
+ /**
43
+ * UUID v4
44
+ */
45
+ clientId: string | null;
46
+ /**
47
+ * UUID v4
48
+ */
49
+ contactId: string | null;
50
+ channel: Channel;
51
+ externalId: string | null;
52
+ saleDate: Date;
53
+ currency: string;
54
+ status: SaleStatus;
55
+ /**
56
+ * ISO 8601 timestamp (UTC)
57
+ */
58
+ voidedAt: Date | null;
59
+ voidReason: string | null;
60
+ taxJurisdiction: string | null;
61
+ taxInclusive: boolean;
62
+ subtotal: number | null;
63
+ discountPercent: number | null;
64
+ discountAmount: number | null;
65
+ taxRate: number | null;
66
+ taxAmount: number | null;
67
+ total: number | null;
68
+ amountRefunded: number;
69
+ notes: string | null;
70
+ /**
71
+ * ISO 8601 timestamp (UTC)
72
+ */
73
+ createdAt: Date;
74
+ /**
75
+ * ISO 8601 timestamp (UTC)
76
+ */
77
+ updatedAt: Date;
78
+ };
79
+
80
+ /** @internal */
81
+ export const Channel$inboundSchema: z.ZodMiniType<Channel, unknown> = openEnums
82
+ .inboundSchema(Channel);
83
+
84
+ /** @internal */
85
+ export const SaleStatus$inboundSchema: z.ZodMiniType<SaleStatus, unknown> =
86
+ openEnums.inboundSchema(SaleStatus);
87
+
88
+ /** @internal */
89
+ export const Sale$inboundSchema: z.ZodMiniType<Sale, unknown> = z.object({
90
+ id: types.string(),
91
+ saleNumber: types.string(),
92
+ businessId: types.nullable(types.string()),
93
+ clientId: types.nullable(types.string()),
94
+ contactId: types.nullable(types.string()),
95
+ channel: Channel$inboundSchema,
96
+ externalId: types.nullable(types.string()),
97
+ saleDate: types.date(),
98
+ currency: types.string(),
99
+ status: SaleStatus$inboundSchema,
100
+ voidedAt: types.nullable(types.date()),
101
+ voidReason: types.nullable(types.string()),
102
+ taxJurisdiction: types.nullable(types.string()),
103
+ taxInclusive: types.boolean(),
104
+ subtotal: types.nullable(types.number()),
105
+ discountPercent: types.nullable(types.number()),
106
+ discountAmount: types.nullable(types.number()),
107
+ taxRate: types.nullable(types.number()),
108
+ taxAmount: types.nullable(types.number()),
109
+ total: types.nullable(types.number()),
110
+ amountRefunded: types.number(),
111
+ notes: types.nullable(types.string()),
112
+ createdAt: types.date(),
113
+ updatedAt: types.date(),
114
+ });
115
+
116
+ export function saleFromJSON(
117
+ jsonString: string,
118
+ ): SafeParseResult<Sale, SDKValidationError> {
119
+ return safeParse(
120
+ jsonString,
121
+ (x) => Sale$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'Sale' from JSON`,
123
+ );
124
+ }
@@ -13,7 +13,6 @@ export const WebhookCreateEvent = {
13
13
  InvoicePaymentFailed: "invoice_payment_failed",
14
14
  InvoiceDisputed: "invoice_disputed",
15
15
  InvoicePaymentReminder: "invoice_payment_reminder",
16
- InvoiceViewed: "invoice_viewed",
17
16
  PaymentReceived: "payment_received",
18
17
  PaymentRefunded: "payment_refunded",
19
18
  PaymentApplied: "payment_applied",
@@ -38,6 +37,7 @@ export const WebhookCreateEvent = {
38
37
  ClientWon: "client_won",
39
38
  ClientLost: "client_lost",
40
39
  LeadStatusChanged: "lead_status_changed",
40
+ InvoiceViewed: "invoice_viewed",
41
41
  MilestoneApproaching: "milestone_approaching",
42
42
  TimerRunningReminder: "timer_running_reminder",
43
43
  ContractSent: "contract_sent",
@@ -48,12 +48,12 @@ export const WebhookCreateEvent = {
48
48
  ContractCompleted: "contract_completed",
49
49
  ContractExpired: "contract_expired",
50
50
  ContractVoided: "contract_voided",
51
+ FormSubmissionCompleted: "form_submission_completed",
51
52
  SmartFileSent: "smart_file_sent",
52
53
  SmartFileViewed: "smart_file_viewed",
53
54
  SmartFileAccepted: "smart_file_accepted",
54
55
  SmartFileCompleted: "smart_file_completed",
55
56
  SmartFileExpired: "smart_file_expired",
56
- FormSubmissionCompleted: "form_submission_completed",
57
57
  SubscriptionPaymentFailed: "subscription_payment_failed",
58
58
  PayoutPaid: "payout_paid",
59
59
  PayoutFailed: "payout_failed",
@@ -62,6 +62,19 @@ export const WebhookCreateEvent = {
62
62
  EventDayArchived: "event_day_archived",
63
63
  TimelineItemCompleted: "timeline_item_completed",
64
64
  TimelineReminderSent: "timeline_reminder_sent",
65
+ InvoiceRefunded: "invoice_refunded",
66
+ ContractAmended: "contract_amended",
67
+ ReceiptViewed: "receipt_viewed",
68
+ FollowUpDue: "follow_up_due",
69
+ PaymentProcessing: "payment_processing",
70
+ ClientReply: "client_reply",
71
+ ClientRevisionRequested: "client_revision_requested",
72
+ EmailDeliveryFailed: "email_delivery_failed",
73
+ SaleCompleted: "sale_completed",
74
+ SaleRefunded: "sale_refunded",
75
+ SaleVoided: "sale_voided",
76
+ SaleReceiptSent: "sale_receipt_sent",
77
+ SaleViewed: "sale_viewed",
65
78
  } as const;
66
79
  export type WebhookCreateEvent = ClosedEnum<typeof WebhookCreateEvent>;
67
80
 
@@ -13,7 +13,6 @@ export const WebhookUpdateEvent = {
13
13
  InvoicePaymentFailed: "invoice_payment_failed",
14
14
  InvoiceDisputed: "invoice_disputed",
15
15
  InvoicePaymentReminder: "invoice_payment_reminder",
16
- InvoiceViewed: "invoice_viewed",
17
16
  PaymentReceived: "payment_received",
18
17
  PaymentRefunded: "payment_refunded",
19
18
  PaymentApplied: "payment_applied",
@@ -38,6 +37,7 @@ export const WebhookUpdateEvent = {
38
37
  ClientWon: "client_won",
39
38
  ClientLost: "client_lost",
40
39
  LeadStatusChanged: "lead_status_changed",
40
+ InvoiceViewed: "invoice_viewed",
41
41
  MilestoneApproaching: "milestone_approaching",
42
42
  TimerRunningReminder: "timer_running_reminder",
43
43
  ContractSent: "contract_sent",
@@ -48,12 +48,12 @@ export const WebhookUpdateEvent = {
48
48
  ContractCompleted: "contract_completed",
49
49
  ContractExpired: "contract_expired",
50
50
  ContractVoided: "contract_voided",
51
+ FormSubmissionCompleted: "form_submission_completed",
51
52
  SmartFileSent: "smart_file_sent",
52
53
  SmartFileViewed: "smart_file_viewed",
53
54
  SmartFileAccepted: "smart_file_accepted",
54
55
  SmartFileCompleted: "smart_file_completed",
55
56
  SmartFileExpired: "smart_file_expired",
56
- FormSubmissionCompleted: "form_submission_completed",
57
57
  SubscriptionPaymentFailed: "subscription_payment_failed",
58
58
  PayoutPaid: "payout_paid",
59
59
  PayoutFailed: "payout_failed",
@@ -62,6 +62,19 @@ export const WebhookUpdateEvent = {
62
62
  EventDayArchived: "event_day_archived",
63
63
  TimelineItemCompleted: "timeline_item_completed",
64
64
  TimelineReminderSent: "timeline_reminder_sent",
65
+ InvoiceRefunded: "invoice_refunded",
66
+ ContractAmended: "contract_amended",
67
+ ReceiptViewed: "receipt_viewed",
68
+ FollowUpDue: "follow_up_due",
69
+ PaymentProcessing: "payment_processing",
70
+ ClientReply: "client_reply",
71
+ ClientRevisionRequested: "client_revision_requested",
72
+ EmailDeliveryFailed: "email_delivery_failed",
73
+ SaleCompleted: "sale_completed",
74
+ SaleRefunded: "sale_refunded",
75
+ SaleVoided: "sale_voided",
76
+ SaleReceiptSent: "sale_receipt_sent",
77
+ SaleViewed: "sale_viewed",
65
78
  } as const;
66
79
  export type WebhookUpdateEvent = ClosedEnum<typeof WebhookUpdateEvent>;
67
80
 
@@ -18,7 +18,6 @@ export const WebhookEvent = {
18
18
  InvoicePaymentFailed: "invoice_payment_failed",
19
19
  InvoiceDisputed: "invoice_disputed",
20
20
  InvoicePaymentReminder: "invoice_payment_reminder",
21
- InvoiceViewed: "invoice_viewed",
22
21
  PaymentReceived: "payment_received",
23
22
  PaymentRefunded: "payment_refunded",
24
23
  PaymentApplied: "payment_applied",
@@ -43,6 +42,7 @@ export const WebhookEvent = {
43
42
  ClientWon: "client_won",
44
43
  ClientLost: "client_lost",
45
44
  LeadStatusChanged: "lead_status_changed",
45
+ InvoiceViewed: "invoice_viewed",
46
46
  MilestoneApproaching: "milestone_approaching",
47
47
  TimerRunningReminder: "timer_running_reminder",
48
48
  ContractSent: "contract_sent",
@@ -53,12 +53,12 @@ export const WebhookEvent = {
53
53
  ContractCompleted: "contract_completed",
54
54
  ContractExpired: "contract_expired",
55
55
  ContractVoided: "contract_voided",
56
+ FormSubmissionCompleted: "form_submission_completed",
56
57
  SmartFileSent: "smart_file_sent",
57
58
  SmartFileViewed: "smart_file_viewed",
58
59
  SmartFileAccepted: "smart_file_accepted",
59
60
  SmartFileCompleted: "smart_file_completed",
60
61
  SmartFileExpired: "smart_file_expired",
61
- FormSubmissionCompleted: "form_submission_completed",
62
62
  SubscriptionPaymentFailed: "subscription_payment_failed",
63
63
  PayoutPaid: "payout_paid",
64
64
  PayoutFailed: "payout_failed",
@@ -67,6 +67,19 @@ export const WebhookEvent = {
67
67
  EventDayArchived: "event_day_archived",
68
68
  TimelineItemCompleted: "timeline_item_completed",
69
69
  TimelineReminderSent: "timeline_reminder_sent",
70
+ InvoiceRefunded: "invoice_refunded",
71
+ ContractAmended: "contract_amended",
72
+ ReceiptViewed: "receipt_viewed",
73
+ FollowUpDue: "follow_up_due",
74
+ PaymentProcessing: "payment_processing",
75
+ ClientReply: "client_reply",
76
+ ClientRevisionRequested: "client_revision_requested",
77
+ EmailDeliveryFailed: "email_delivery_failed",
78
+ SaleCompleted: "sale_completed",
79
+ SaleRefunded: "sale_refunded",
80
+ SaleVoided: "sale_voided",
81
+ SaleReceiptSent: "sale_receipt_sent",
82
+ SaleViewed: "sale_viewed",
70
83
  } as const;
71
84
  export type WebhookEvent = OpenEnum<typeof WebhookEvent>;
72
85
 
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { salesGet } from "../funcs/sales-get.js";
6
+ import { salesList } from "../funcs/sales-list.js";
7
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
+ import * as models from "../models/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { unwrapAsync } from "../types/fp.js";
11
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
12
+
13
+ export class Sales extends ClientSDK {
14
+ /**
15
+ * List sales
16
+ */
17
+ async list(
18
+ security: operations.ListSalesSecurity,
19
+ request?: operations.ListSalesRequest | undefined,
20
+ options?: RequestOptions,
21
+ ): Promise<PageIterator<operations.ListSalesResponse, { page: number }>> {
22
+ return unwrapResultIterator(salesList(
23
+ this,
24
+ security,
25
+ request,
26
+ options,
27
+ ));
28
+ }
29
+
30
+ /**
31
+ * Get a sale
32
+ */
33
+ async get(
34
+ security: operations.GetSaleSecurity,
35
+ request: operations.GetSaleRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<models.Sale> {
38
+ return unwrapAsync(salesGet(
39
+ this,
40
+ security,
41
+ request,
42
+ options,
43
+ ));
44
+ }
45
+ }
package/src/sdk/sdk.ts CHANGED
@@ -20,6 +20,7 @@ import { Milestones } from "./milestones.js";
20
20
  import { Payments } from "./payments.js";
21
21
  import { Payouts } from "./payouts.js";
22
22
  import { Projects } from "./projects.js";
23
+ import { Sales } from "./sales.js";
23
24
  import { TimeEntries } from "./time-entries.js";
24
25
  import { TimelineItems } from "./timeline-items.js";
25
26
  import { Transactions } from "./transactions.js";
@@ -88,6 +89,11 @@ export class ClientCasa extends ClientSDK {
88
89
  return (this._payouts ??= new Payouts(this._options));
89
90
  }
90
91
 
92
+ private _sales?: Sales;
93
+ get sales(): Sales {
94
+ return (this._sales ??= new Sales(this._options));
95
+ }
96
+
91
97
  private _timeEntries?: TimeEntries;
92
98
  get timeEntries(): TimeEntries {
93
99
  return (this._timeEntries ??= new TimeEntries(this._options));