@clientcasa/sdk 0.6.5 → 0.7.1
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.
- package/README.md +7 -0
- package/esm/funcs/payments-list.js +1 -0
- package/esm/funcs/payments-list.js.map +1 -1
- package/esm/funcs/sales-get.d.ts +16 -0
- package/esm/funcs/sales-get.d.ts.map +1 -0
- package/esm/funcs/sales-get.js +107 -0
- package/esm/funcs/sales-get.js.map +1 -0
- package/esm/funcs/sales-list.d.ts +18 -0
- package/esm/funcs/sales-list.d.ts.map +1 -0
- package/esm/funcs/sales-list.js +141 -0
- package/esm/funcs/sales-list.js.map +1 -0
- package/esm/funcs/transactions-create.d.ts +3 -0
- package/esm/funcs/transactions-create.d.ts.map +1 -1
- package/esm/funcs/transactions-create.js +3 -0
- package/esm/funcs/transactions-create.js.map +1 -1
- package/esm/funcs/transactions-update.d.ts +1 -1
- package/esm/funcs/transactions-update.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.d.ts +10 -9
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +29 -13
- package/esm/lib/encodings.js.map +1 -1
- package/esm/models/api-error.d.ts +25 -3
- package/esm/models/api-error.d.ts.map +1 -1
- package/esm/models/api-error.js +25 -1
- package/esm/models/api-error.js.map +1 -1
- package/esm/models/catalog-item-create.d.ts +5 -0
- package/esm/models/catalog-item-create.d.ts.map +1 -1
- package/esm/models/catalog-item-create.js +1 -0
- package/esm/models/catalog-item-create.js.map +1 -1
- package/esm/models/catalog-item-update.d.ts +4 -4
- package/esm/models/catalog-item-update.d.ts.map +1 -1
- package/esm/models/catalog-item-update.js +4 -4
- package/esm/models/catalog-item-update.js.map +1 -1
- package/esm/models/catalog-item.d.ts +4 -0
- package/esm/models/catalog-item.d.ts.map +1 -1
- package/esm/models/catalog-item.js +1 -0
- package/esm/models/catalog-item.js.map +1 -1
- package/esm/models/client-create.d.ts +5 -0
- package/esm/models/client-create.d.ts.map +1 -1
- package/esm/models/client-create.js +1 -0
- package/esm/models/client-create.js.map +1 -1
- package/esm/models/client-update.d.ts +1 -1
- package/esm/models/client-update.d.ts.map +1 -1
- package/esm/models/client-update.js +1 -1
- package/esm/models/client-update.js.map +1 -1
- package/esm/models/client.d.ts +4 -0
- package/esm/models/client.d.ts.map +1 -1
- package/esm/models/client.js +1 -0
- package/esm/models/client.js.map +1 -1
- package/esm/models/contact-update.d.ts +2 -2
- package/esm/models/contact-update.d.ts.map +1 -1
- package/esm/models/contact-update.js +2 -2
- package/esm/models/contact-update.js.map +1 -1
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +2 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/operations/get-sale.d.ts +27 -0
- package/esm/models/operations/get-sale.d.ts.map +1 -0
- package/esm/models/operations/get-sale.js +20 -0
- package/esm/models/operations/get-sale.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-payments.d.ts +5 -0
- package/esm/models/operations/list-payments.d.ts.map +1 -1
- package/esm/models/operations/list-payments.js +1 -0
- package/esm/models/operations/list-payments.js.map +1 -1
- package/esm/models/operations/list-sales.d.ts +75 -0
- package/esm/models/operations/list-sales.d.ts.map +1 -0
- package/esm/models/operations/list-sales.js +60 -0
- package/esm/models/operations/list-sales.js.map +1 -0
- package/esm/models/operations/list-webhooks.d.ts +15 -2
- package/esm/models/operations/list-webhooks.d.ts.map +1 -1
- package/esm/models/operations/list-webhooks.js +15 -2
- package/esm/models/operations/list-webhooks.js.map +1 -1
- package/esm/models/payment.d.ts +5 -1
- package/esm/models/payment.d.ts.map +1 -1
- package/esm/models/payment.js +2 -1
- package/esm/models/payment.js.map +1 -1
- package/esm/models/project-update.d.ts +1 -1
- package/esm/models/project-update.d.ts.map +1 -1
- package/esm/models/project-update.js +1 -1
- package/esm/models/project-update.js.map +1 -1
- package/esm/models/project.d.ts +5 -1
- package/esm/models/project.d.ts.map +1 -1
- package/esm/models/project.js +2 -1
- package/esm/models/project.js.map +1 -1
- package/esm/models/sale-list.d.ts +13 -0
- package/esm/models/sale-list.d.ts.map +1 -0
- package/esm/models/sale-list.js +17 -0
- package/esm/models/sale-list.js.map +1 -0
- package/esm/models/sale.d.ts +76 -0
- package/esm/models/sale.d.ts.map +1 -0
- package/esm/models/sale.js +58 -0
- package/esm/models/sale.js.map +1 -0
- package/esm/models/time-entry-update.d.ts +2 -2
- package/esm/models/time-entry-update.d.ts.map +1 -1
- package/esm/models/time-entry-update.js +2 -2
- package/esm/models/time-entry-update.js.map +1 -1
- package/esm/models/time-entry.d.ts +3 -3
- package/esm/models/time-entry.d.ts.map +1 -1
- package/esm/models/time-entry.js +3 -3
- package/esm/models/time-entry.js.map +1 -1
- package/esm/models/transaction-create.d.ts +5 -0
- package/esm/models/transaction-create.d.ts.map +1 -1
- package/esm/models/transaction-create.js +1 -0
- package/esm/models/transaction-create.js.map +1 -1
- package/esm/models/transaction-update.d.ts +3 -3
- package/esm/models/transaction-update.d.ts.map +1 -1
- package/esm/models/transaction-update.js +3 -3
- package/esm/models/transaction-update.js.map +1 -1
- package/esm/models/transaction.d.ts +4 -0
- package/esm/models/transaction.d.ts.map +1 -1
- package/esm/models/transaction.js +1 -0
- package/esm/models/transaction.js.map +1 -1
- package/esm/models/webhook-create.d.ts +15 -2
- package/esm/models/webhook-create.d.ts.map +1 -1
- package/esm/models/webhook-create.js +15 -2
- package/esm/models/webhook-create.js.map +1 -1
- package/esm/models/webhook-update.d.ts +15 -2
- package/esm/models/webhook-update.d.ts.map +1 -1
- package/esm/models/webhook-update.js +15 -2
- package/esm/models/webhook-update.js.map +1 -1
- package/esm/models/webhook.d.ts +15 -2
- package/esm/models/webhook.d.ts.map +1 -1
- package/esm/models/webhook.js +15 -2
- package/esm/models/webhook.js.map +1 -1
- package/esm/sdk/sales.d.ts +17 -0
- package/esm/sdk/sales.d.ts.map +1 -0
- package/esm/sdk/sales.js +23 -0
- package/esm/sdk/sales.js.map +1 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/transactions.d.ts +4 -1
- package/esm/sdk/transactions.d.ts.map +1 -1
- package/esm/sdk/transactions.js +4 -1
- package/esm/sdk/transactions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/payments-list.ts +1 -0
- package/src/funcs/sales-get.ts +202 -0
- package/src/funcs/sales-list.ts +277 -0
- package/src/funcs/transactions-create.ts +3 -0
- package/src/funcs/transactions-update.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +58 -23
- package/src/models/api-error.ts +46 -2
- package/src/models/catalog-item-create.ts +6 -0
- package/src/models/catalog-item-update.ts +8 -9
- package/src/models/catalog-item.ts +5 -0
- package/src/models/client-create.ts +6 -0
- package/src/models/client-update.ts +2 -2
- package/src/models/client.ts +5 -0
- package/src/models/contact-update.ts +4 -4
- package/src/models/index.ts +2 -0
- package/src/models/operations/get-sale.ts +55 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/list-payments.ts +6 -0
- package/src/models/operations/list-sales.ts +159 -0
- package/src/models/operations/list-webhooks.ts +15 -2
- package/src/models/payment.ts +7 -2
- package/src/models/project-update.ts +2 -2
- package/src/models/project.ts +7 -2
- package/src/models/sale-list.ts +35 -0
- package/src/models/sale.ts +124 -0
- package/src/models/time-entry-update.ts +4 -4
- package/src/models/time-entry.ts +6 -6
- package/src/models/transaction-create.ts +6 -0
- package/src/models/transaction-update.ts +6 -6
- package/src/models/transaction.ts +5 -0
- package/src/models/webhook-create.ts +15 -2
- package/src/models/webhook-update.ts +15 -2
- package/src/models/webhook.ts +15 -2
- package/src/sdk/sales.ts +45 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transactions.ts +4 -1
package/src/models/webhook.ts
CHANGED
|
@@ -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
|
|
package/src/sdk/sales.ts
ADDED
|
@@ -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));
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -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,
|