@clientcasa/sdk 0.1.0 → 0.1.3
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 +106 -92
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/catalog-item-create.d.ts +10 -0
- package/esm/models/catalog-item-create.d.ts.map +1 -1
- package/esm/models/catalog-item-create.js +8 -0
- package/esm/models/catalog-item-create.js.map +1 -1
- package/esm/models/catalog-item-update.d.ts +10 -0
- package/esm/models/catalog-item-update.d.ts.map +1 -1
- package/esm/models/catalog-item-update.js +8 -0
- package/esm/models/catalog-item-update.js.map +1 -1
- package/esm/models/catalog-item.d.ts +9 -0
- package/esm/models/catalog-item.d.ts.map +1 -1
- package/esm/models/catalog-item.js +8 -0
- package/esm/models/catalog-item.js.map +1 -1
- package/esm/models/invoice-create.d.ts +0 -1
- package/esm/models/invoice-create.d.ts.map +1 -1
- package/esm/models/invoice-create.js +0 -1
- package/esm/models/invoice-create.js.map +1 -1
- package/esm/models/payout.d.ts +1 -1
- package/esm/models/payout.d.ts.map +1 -1
- package/esm/models/payout.js +1 -1
- package/esm/models/payout.js.map +1 -1
- package/esm/models/time-entry-create.d.ts +0 -2
- package/esm/models/time-entry-create.d.ts.map +1 -1
- package/esm/models/time-entry-create.js +0 -1
- package/esm/models/time-entry-create.js.map +1 -1
- package/esm/models/time-entry-update.d.ts +0 -2
- package/esm/models/time-entry-update.d.ts.map +1 -1
- package/esm/models/time-entry-update.js +0 -1
- package/esm/models/time-entry-update.js.map +1 -1
- package/esm/models/time-entry.d.ts +0 -1
- package/esm/models/time-entry.d.ts.map +1 -1
- package/esm/models/time-entry.js +0 -1
- package/esm/models/time-entry.js.map +1 -1
- package/esm/models/transaction.d.ts +1 -1
- package/esm/models/transaction.d.ts.map +1 -1
- package/esm/models/transaction.js +1 -1
- package/esm/models/transaction.js.map +1 -1
- package/esm/sdk/calendar-events.d.ts +4 -4
- package/esm/sdk/calendar-events.d.ts.map +1 -1
- package/esm/sdk/calendar-events.js +6 -6
- package/esm/sdk/calendar-events.js.map +1 -1
- package/esm/sdk/catalog-items.d.ts +4 -4
- package/esm/sdk/catalog-items.d.ts.map +1 -1
- package/esm/sdk/catalog-items.js +6 -6
- package/esm/sdk/catalog-items.js.map +1 -1
- package/esm/sdk/clients.d.ts +4 -4
- package/esm/sdk/clients.d.ts.map +1 -1
- package/esm/sdk/clients.js +6 -6
- package/esm/sdk/clients.js.map +1 -1
- package/esm/sdk/contacts.d.ts +4 -4
- package/esm/sdk/contacts.d.ts.map +1 -1
- package/esm/sdk/contacts.js +6 -6
- package/esm/sdk/contacts.js.map +1 -1
- package/esm/sdk/contracts.d.ts +4 -4
- package/esm/sdk/contracts.d.ts.map +1 -1
- package/esm/sdk/contracts.js +6 -6
- package/esm/sdk/contracts.js.map +1 -1
- package/esm/sdk/inquiries.d.ts +4 -4
- package/esm/sdk/inquiries.d.ts.map +1 -1
- package/esm/sdk/inquiries.js +6 -6
- package/esm/sdk/inquiries.js.map +1 -1
- package/esm/sdk/invoices.d.ts +4 -4
- package/esm/sdk/invoices.d.ts.map +1 -1
- package/esm/sdk/invoices.js +6 -6
- package/esm/sdk/invoices.js.map +1 -1
- package/esm/sdk/milestones.d.ts +4 -4
- package/esm/sdk/milestones.d.ts.map +1 -1
- package/esm/sdk/milestones.js +6 -6
- package/esm/sdk/milestones.js.map +1 -1
- package/esm/sdk/projects.d.ts +4 -4
- package/esm/sdk/projects.d.ts.map +1 -1
- package/esm/sdk/projects.js +6 -6
- package/esm/sdk/projects.js.map +1 -1
- package/esm/sdk/proposals.d.ts +4 -4
- package/esm/sdk/proposals.d.ts.map +1 -1
- package/esm/sdk/proposals.js +6 -6
- package/esm/sdk/proposals.js.map +1 -1
- package/esm/sdk/time-entries.d.ts +6 -6
- package/esm/sdk/time-entries.d.ts.map +1 -1
- package/esm/sdk/time-entries.js +8 -8
- package/esm/sdk/time-entries.js.map +1 -1
- package/esm/sdk/transactions.d.ts +6 -6
- package/esm/sdk/transactions.d.ts.map +1 -1
- package/esm/sdk/transactions.js +8 -8
- package/esm/sdk/transactions.js.map +1 -1
- package/esm/sdk/webhooks.d.ts +4 -4
- package/esm/sdk/webhooks.d.ts.map +1 -1
- package/esm/sdk/webhooks.js +6 -6
- package/esm/sdk/webhooks.js.map +1 -1
- package/esm/types/async.d.ts.map +1 -1
- package/esm/types/async.js +6 -6
- package/esm/types/async.js.map +1 -1
- package/esm/types/primitives.d.ts +0 -2
- package/esm/types/primitives.d.ts.map +1 -1
- package/esm/types/primitives.js +0 -22
- package/esm/types/primitives.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +6 -24
- package/src/lib/config.ts +3 -3
- package/src/models/catalog-item-create.ts +17 -0
- package/src/models/catalog-item-update.ts +17 -0
- package/src/models/catalog-item.ts +15 -0
- package/src/models/invoice-create.ts +0 -1
- package/src/models/payout.ts +2 -2
- package/src/models/time-entry-create.ts +0 -3
- package/src/models/time-entry-update.ts +0 -3
- package/src/models/time-entry.ts +0 -2
- package/src/models/transaction.ts +2 -2
- package/src/sdk/calendar-events.ts +15 -15
- package/src/sdk/catalog-items.ts +12 -12
- package/src/sdk/clients.ts +12 -12
- package/src/sdk/contacts.ts +12 -12
- package/src/sdk/contracts.ts +15 -15
- package/src/sdk/inquiries.ts +15 -15
- package/src/sdk/invoices.ts +12 -12
- package/src/sdk/milestones.ts +12 -12
- package/src/sdk/projects.ts +12 -12
- package/src/sdk/proposals.ts +15 -15
- package/src/sdk/time-entries.ts +14 -14
- package/src/sdk/transactions.ts +14 -14
- package/src/sdk/webhooks.ts +15 -15
- package/src/types/async.ts +8 -7
- package/src/types/primitives.ts +0 -26
package/src/sdk/contracts.ts
CHANGED
|
@@ -65,17 +65,14 @@ export class Contracts extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* Only `title`, `effectiveDate`, `expirationDate`, and `archived` are editable via v1. `title`/`effectiveDate`/`expirationDate` are draft-only; `archived` is always editable.
|
|
68
|
+
* Delete a contract (only drafts)
|
|
72
69
|
*/
|
|
73
|
-
async
|
|
74
|
-
security: operations.
|
|
75
|
-
request: operations.
|
|
70
|
+
async deleteContract(
|
|
71
|
+
security: operations.DeleteContractSecurity,
|
|
72
|
+
request: operations.DeleteContractRequest,
|
|
76
73
|
options?: RequestOptions,
|
|
77
|
-
): Promise<
|
|
78
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(contractsDeleteContract(
|
|
79
76
|
this,
|
|
80
77
|
security,
|
|
81
78
|
request,
|
|
@@ -84,14 +81,17 @@ export class Contracts extends ClientSDK {
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
|
-
*
|
|
84
|
+
* Update a contract (limited fields)
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Only `title`, `effectiveDate`, `expirationDate`, and `archived` are editable via v1. `title`/`effectiveDate`/`expirationDate` are draft-only; `archived` is always editable.
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateContract(
|
|
90
|
+
security: operations.UpdateContractSecurity,
|
|
91
|
+
request: operations.UpdateContractRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.Contract> {
|
|
94
|
+
return unwrapAsync(contractsUpdateContract(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/sdk/inquiries.ts
CHANGED
|
@@ -65,17 +65,14 @@ export class Inquiries extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* Status `converted` is terminal and set by the dashboard conversion flow. Transitions out of `converted` or `spam` are blocked.
|
|
68
|
+
* Delete an inquiry
|
|
72
69
|
*/
|
|
73
|
-
async
|
|
74
|
-
security: operations.
|
|
75
|
-
request: operations.
|
|
70
|
+
async deleteInquiry(
|
|
71
|
+
security: operations.DeleteInquirySecurity,
|
|
72
|
+
request: operations.DeleteInquiryRequest,
|
|
76
73
|
options?: RequestOptions,
|
|
77
|
-
): Promise<
|
|
78
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(inquiriesDeleteInquiry(
|
|
79
76
|
this,
|
|
80
77
|
security,
|
|
81
78
|
request,
|
|
@@ -84,14 +81,17 @@ export class Inquiries extends ClientSDK {
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
|
-
*
|
|
84
|
+
* Update an inquiry
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Status `converted` is terminal and set by the dashboard conversion flow. Transitions out of `converted` or `spam` are blocked.
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateInquiry(
|
|
90
|
+
security: operations.UpdateInquirySecurity,
|
|
91
|
+
request: operations.UpdateInquiryRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.Inquiry> {
|
|
94
|
+
return unwrapAsync(inquiriesUpdateInquiry(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/sdk/invoices.ts
CHANGED
|
@@ -65,14 +65,14 @@ export class Invoices extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Delete an invoice (only drafts)
|
|
69
69
|
*/
|
|
70
|
-
async
|
|
71
|
-
security: operations.
|
|
72
|
-
request: operations.
|
|
70
|
+
async deleteInvoice(
|
|
71
|
+
security: operations.DeleteInvoiceSecurity,
|
|
72
|
+
request: operations.DeleteInvoiceRequest,
|
|
73
73
|
options?: RequestOptions,
|
|
74
|
-
): Promise<
|
|
75
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(invoicesDeleteInvoice(
|
|
76
76
|
this,
|
|
77
77
|
security,
|
|
78
78
|
request,
|
|
@@ -81,14 +81,14 @@ export class Invoices extends ClientSDK {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Update an invoice (line items not editable in v1)
|
|
85
85
|
*/
|
|
86
|
-
async
|
|
87
|
-
security: operations.
|
|
88
|
-
request: operations.
|
|
86
|
+
async updateInvoice(
|
|
87
|
+
security: operations.UpdateInvoiceSecurity,
|
|
88
|
+
request: operations.UpdateInvoiceRequest,
|
|
89
89
|
options?: RequestOptions,
|
|
90
|
-
): Promise<
|
|
91
|
-
return unwrapAsync(
|
|
90
|
+
): Promise<models.Invoice> {
|
|
91
|
+
return unwrapAsync(invoicesUpdateInvoice(
|
|
92
92
|
this,
|
|
93
93
|
security,
|
|
94
94
|
request,
|
package/src/sdk/milestones.ts
CHANGED
|
@@ -65,14 +65,14 @@ export class Milestones extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Delete a milestone
|
|
69
69
|
*/
|
|
70
|
-
async
|
|
71
|
-
security: operations.
|
|
72
|
-
request: operations.
|
|
70
|
+
async deleteMilestone(
|
|
71
|
+
security: operations.DeleteMilestoneSecurity,
|
|
72
|
+
request: operations.DeleteMilestoneRequest,
|
|
73
73
|
options?: RequestOptions,
|
|
74
|
-
): Promise<
|
|
75
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(milestonesDeleteMilestone(
|
|
76
76
|
this,
|
|
77
77
|
security,
|
|
78
78
|
request,
|
|
@@ -81,14 +81,14 @@ export class Milestones extends ClientSDK {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Update a milestone
|
|
85
85
|
*/
|
|
86
|
-
async
|
|
87
|
-
security: operations.
|
|
88
|
-
request: operations.
|
|
86
|
+
async updateMilestone(
|
|
87
|
+
security: operations.UpdateMilestoneSecurity,
|
|
88
|
+
request: operations.UpdateMilestoneRequest,
|
|
89
89
|
options?: RequestOptions,
|
|
90
|
-
): Promise<
|
|
91
|
-
return unwrapAsync(
|
|
90
|
+
): Promise<models.Milestone> {
|
|
91
|
+
return unwrapAsync(milestonesUpdateMilestone(
|
|
92
92
|
this,
|
|
93
93
|
security,
|
|
94
94
|
request,
|
package/src/sdk/projects.ts
CHANGED
|
@@ -62,14 +62,14 @@ export class Projects extends ClientSDK {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Delete a project
|
|
66
66
|
*/
|
|
67
|
-
async
|
|
68
|
-
security: operations.
|
|
69
|
-
request: operations.
|
|
67
|
+
async deleteProject(
|
|
68
|
+
security: operations.DeleteProjectSecurity,
|
|
69
|
+
request: operations.DeleteProjectRequest,
|
|
70
70
|
options?: RequestOptions,
|
|
71
|
-
): Promise<
|
|
72
|
-
return unwrapAsync(
|
|
71
|
+
): Promise<void> {
|
|
72
|
+
return unwrapAsync(projectsDeleteProject(
|
|
73
73
|
this,
|
|
74
74
|
security,
|
|
75
75
|
request,
|
|
@@ -78,14 +78,14 @@ export class Projects extends ClientSDK {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Update a project
|
|
82
82
|
*/
|
|
83
|
-
async
|
|
84
|
-
security: operations.
|
|
85
|
-
request: operations.
|
|
83
|
+
async updateProject(
|
|
84
|
+
security: operations.UpdateProjectSecurity,
|
|
85
|
+
request: operations.UpdateProjectRequest,
|
|
86
86
|
options?: RequestOptions,
|
|
87
|
-
): Promise<
|
|
88
|
-
return unwrapAsync(
|
|
87
|
+
): Promise<models.Project> {
|
|
88
|
+
return unwrapAsync(projectsUpdateProject(
|
|
89
89
|
this,
|
|
90
90
|
security,
|
|
91
91
|
request,
|
package/src/sdk/proposals.ts
CHANGED
|
@@ -65,17 +65,14 @@ export class Proposals extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* Status transitions to `accepted`/`rejected`/`expired` are system-driven; do not set them directly.
|
|
68
|
+
* Delete a proposal (only drafts)
|
|
72
69
|
*/
|
|
73
|
-
async
|
|
74
|
-
security: operations.
|
|
75
|
-
request: operations.
|
|
70
|
+
async deleteProposal(
|
|
71
|
+
security: operations.DeleteProposalSecurity,
|
|
72
|
+
request: operations.DeleteProposalRequest,
|
|
76
73
|
options?: RequestOptions,
|
|
77
|
-
): Promise<
|
|
78
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(proposalsDeleteProposal(
|
|
79
76
|
this,
|
|
80
77
|
security,
|
|
81
78
|
request,
|
|
@@ -84,14 +81,17 @@ export class Proposals extends ClientSDK {
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
|
-
*
|
|
84
|
+
* Update a proposal
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Status transitions to `accepted`/`rejected`/`expired` are system-driven; do not set them directly.
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateProposal(
|
|
90
|
+
security: operations.UpdateProposalSecurity,
|
|
91
|
+
request: operations.UpdateProposalRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.Proposal> {
|
|
94
|
+
return unwrapAsync(proposalsUpdateProposal(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/sdk/time-entries.ts
CHANGED
|
@@ -62,17 +62,17 @@ export class TimeEntries extends ClientSDK {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Delete a time entry
|
|
66
66
|
*
|
|
67
67
|
* @remarks
|
|
68
|
-
* Time entries billed to a paid invoice cannot be
|
|
68
|
+
* Time entries billed to a paid invoice cannot be deleted.
|
|
69
69
|
*/
|
|
70
|
-
async
|
|
71
|
-
security: operations.
|
|
72
|
-
request: operations.
|
|
70
|
+
async deleteTimeEntry(
|
|
71
|
+
security: operations.DeleteTimeEntrySecurity,
|
|
72
|
+
request: operations.DeleteTimeEntryRequest,
|
|
73
73
|
options?: RequestOptions,
|
|
74
|
-
): Promise<
|
|
75
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(timeEntriesDeleteTimeEntry(
|
|
76
76
|
this,
|
|
77
77
|
security,
|
|
78
78
|
request,
|
|
@@ -81,17 +81,17 @@ export class TimeEntries extends ClientSDK {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Update a time entry
|
|
85
85
|
*
|
|
86
86
|
* @remarks
|
|
87
|
-
* Time entries billed to a paid invoice cannot be
|
|
87
|
+
* Time entries billed to a paid invoice cannot be edited (the date field is immutable in that case).
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateTimeEntry(
|
|
90
|
+
security: operations.UpdateTimeEntrySecurity,
|
|
91
|
+
request: operations.UpdateTimeEntryRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.TimeEntry> {
|
|
94
|
+
return unwrapAsync(timeEntriesUpdateTimeEntry(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -62,17 +62,17 @@ export class Transactions extends ClientSDK {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Delete a transaction
|
|
66
66
|
*
|
|
67
67
|
* @remarks
|
|
68
|
-
* Transactions billed to a sent/paid invoice
|
|
68
|
+
* Transactions billed to a sent/paid invoice cannot be deleted.
|
|
69
69
|
*/
|
|
70
|
-
async
|
|
71
|
-
security: operations.
|
|
72
|
-
request: operations.
|
|
70
|
+
async deleteTransaction(
|
|
71
|
+
security: operations.DeleteTransactionSecurity,
|
|
72
|
+
request: operations.DeleteTransactionRequest,
|
|
73
73
|
options?: RequestOptions,
|
|
74
|
-
): Promise<
|
|
75
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(transactionsDeleteTransaction(
|
|
76
76
|
this,
|
|
77
77
|
security,
|
|
78
78
|
request,
|
|
@@ -81,17 +81,17 @@ export class Transactions extends ClientSDK {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Update a transaction
|
|
85
85
|
*
|
|
86
86
|
* @remarks
|
|
87
|
-
* Transactions billed to a sent/paid invoice
|
|
87
|
+
* Transactions billed to a sent/paid invoice may be frozen — the server will return 409 if so.
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateTransaction(
|
|
90
|
+
security: operations.UpdateTransactionSecurity,
|
|
91
|
+
request: operations.UpdateTransactionRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.Transaction> {
|
|
94
|
+
return unwrapAsync(transactionsUpdateTransaction(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/sdk/webhooks.ts
CHANGED
|
@@ -65,17 +65,14 @@ export class Webhooks extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* Pass `secret: null` to remove the signing secret. Pass a new string to rotate.
|
|
68
|
+
* Delete a webhook
|
|
72
69
|
*/
|
|
73
|
-
async
|
|
74
|
-
security: operations.
|
|
75
|
-
request: operations.
|
|
70
|
+
async deleteWebhook(
|
|
71
|
+
security: operations.DeleteWebhookSecurity,
|
|
72
|
+
request: operations.DeleteWebhookRequest,
|
|
76
73
|
options?: RequestOptions,
|
|
77
|
-
): Promise<
|
|
78
|
-
return unwrapAsync(
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
return unwrapAsync(webhooksDeleteWebhook(
|
|
79
76
|
this,
|
|
80
77
|
security,
|
|
81
78
|
request,
|
|
@@ -84,14 +81,17 @@ export class Webhooks extends ClientSDK {
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
|
-
*
|
|
84
|
+
* Update a webhook
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Pass `secret: null` to remove the signing secret. Pass a new string to rotate.
|
|
88
88
|
*/
|
|
89
|
-
async
|
|
90
|
-
security: operations.
|
|
91
|
-
request: operations.
|
|
89
|
+
async updateWebhook(
|
|
90
|
+
security: operations.UpdateWebhookSecurity,
|
|
91
|
+
request: operations.UpdateWebhookRequest,
|
|
92
92
|
options?: RequestOptions,
|
|
93
|
-
): Promise<
|
|
94
|
-
return unwrapAsync(
|
|
93
|
+
): Promise<models.Webhook> {
|
|
94
|
+
return unwrapAsync(webhooksUpdateWebhook(
|
|
95
95
|
this,
|
|
96
96
|
security,
|
|
97
97
|
request,
|
package/src/types/async.ts
CHANGED
|
@@ -21,16 +21,17 @@ export type APICall =
|
|
|
21
21
|
|
|
22
22
|
export class APIPromise<T> implements Promise<T> {
|
|
23
23
|
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
-
|
|
24
|
+
#unwrapped: Promise<T> | null;
|
|
25
25
|
|
|
26
26
|
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
27
|
|
|
28
28
|
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
29
|
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
-
this.#unwrapped =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#getUnwrapped(): Promise<T> {
|
|
34
|
+
return (this.#unwrapped ??= this.#promise.then(([value]) => value));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
then<TResult1 = T, TResult2 = never>(
|
|
@@ -55,11 +56,11 @@ export class APIPromise<T> implements Promise<T> {
|
|
|
55
56
|
| null
|
|
56
57
|
| undefined,
|
|
57
58
|
): Promise<T | TResult> {
|
|
58
|
-
return this.#
|
|
59
|
+
return this.#getUnwrapped().catch(onrejected);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
-
return this.#
|
|
63
|
+
return this.#getUnwrapped().finally(onfinally);
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
$inspect(): Promise<[T, APICall]> {
|
package/src/types/primitives.ts
CHANGED
|
@@ -70,28 +70,6 @@ export function number(): z.ZodMiniType<number> {
|
|
|
70
70
|
]);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export function bigint(): z.ZodMiniType<bigint> {
|
|
74
|
-
return z.union([
|
|
75
|
-
z.pipe(
|
|
76
|
-
z.string(),
|
|
77
|
-
z.transform((x, ctx) => {
|
|
78
|
-
try {
|
|
79
|
-
return BigInt(x);
|
|
80
|
-
} catch (error) {
|
|
81
|
-
ctx.issues.push({
|
|
82
|
-
input: x,
|
|
83
|
-
code: "invalid_type",
|
|
84
|
-
expected: "bigint",
|
|
85
|
-
received: "string",
|
|
86
|
-
});
|
|
87
|
-
return z.NEVER;
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
),
|
|
91
|
-
zodDefaultToZeroValue(0n),
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
73
|
export function date(): z.ZodMiniType<Date> {
|
|
96
74
|
return z.union([
|
|
97
75
|
z.pipe(
|
|
@@ -126,10 +104,6 @@ export function literal<T extends string | number | boolean>(
|
|
|
126
104
|
return z.union([z.literal(value), zodDefaultToZeroValue(value)]);
|
|
127
105
|
}
|
|
128
106
|
|
|
129
|
-
export function literalBigInt<T extends bigint>(value: T): z.ZodMiniType<T> {
|
|
130
|
-
return z.pipe(z.literal(String(value)), z.transform((x) => BigInt(x))) as any;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
107
|
export function optional<T extends z.ZodMiniType>(t: T) {
|
|
134
108
|
return z.optional(z.union([
|
|
135
109
|
// Null -> undefined
|