@clientcasa/sdk 0.3.0 → 0.4.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 +19 -24
- package/esm/funcs/catalog-items-list.js +1 -0
- package/esm/funcs/catalog-items-list.js.map +1 -1
- package/esm/funcs/{inquiries-get.d.ts → form-submissions-get.d.ts} +3 -3
- package/esm/funcs/form-submissions-get.d.ts.map +1 -0
- package/esm/funcs/{inquiries-delete.js → form-submissions-get.js} +9 -8
- package/esm/funcs/form-submissions-get.js.map +1 -0
- package/esm/funcs/form-submissions-list.d.ts +21 -0
- package/esm/funcs/form-submissions-list.d.ts.map +1 -0
- package/esm/funcs/{inquiries-list.js → form-submissions-list.js} +14 -9
- package/esm/funcs/form-submissions-list.js.map +1 -0
- package/esm/funcs/{proposals-get.d.ts → forms-and-agreements-get.d.ts} +2 -2
- package/esm/funcs/forms-and-agreements-get.d.ts.map +1 -0
- package/esm/funcs/{proposals-get.js → forms-and-agreements-get.js} +6 -6
- package/esm/funcs/forms-and-agreements-get.js.map +1 -0
- package/esm/funcs/{inquiries-delete.d.ts → forms-and-agreements-list.d.ts} +6 -3
- package/esm/funcs/forms-and-agreements-list.d.ts.map +1 -0
- package/esm/funcs/{proposals-list.js → forms-and-agreements-list.js} +8 -8
- package/esm/funcs/forms-and-agreements-list.js.map +1 -0
- package/esm/funcs/{proposals-list.d.ts → forms-get.d.ts} +4 -6
- package/esm/funcs/forms-get.d.ts.map +1 -0
- package/esm/funcs/{inquiries-get.js → forms-get.js} +7 -7
- package/esm/funcs/forms-get.js.map +1 -0
- package/esm/funcs/{inquiries-list.d.ts → forms-list.d.ts} +3 -3
- package/esm/funcs/forms-list.d.ts.map +1 -0
- package/esm/funcs/forms-list.js +138 -0
- package/esm/funcs/forms-list.js.map +1 -0
- package/esm/funcs/invoices-create.d.ts +1 -1
- package/esm/funcs/invoices-create.js +1 -1
- package/esm/funcs/invoices-list.js +1 -0
- package/esm/funcs/invoices-list.js.map +1 -1
- package/esm/funcs/milestones-create.d.ts +1 -1
- package/esm/funcs/milestones-create.js +1 -1
- package/esm/hooks/types.d.ts +1 -0
- package/esm/hooks/types.d.ts.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/sdks.d.ts.map +1 -1
- package/esm/lib/sdks.js +13 -4
- package/esm/lib/sdks.js.map +1 -1
- package/esm/models/api-error.d.ts +1 -0
- package/esm/models/api-error.d.ts.map +1 -1
- package/esm/models/api-error.js +1 -0
- package/esm/models/api-error.js.map +1 -1
- package/esm/models/catalog-item.d.ts +17 -0
- package/esm/models/catalog-item.d.ts.map +1 -1
- package/esm/models/catalog-item.js +15 -0
- package/esm/models/catalog-item.js.map +1 -1
- package/esm/models/client-create.d.ts +5 -1
- package/esm/models/client-create.d.ts.map +1 -1
- package/esm/models/client-create.js +5 -1
- package/esm/models/client-create.js.map +1 -1
- package/esm/models/client-document-list.d.ts +13 -0
- package/esm/models/client-document-list.d.ts.map +1 -0
- package/esm/models/client-document-list.js +16 -0
- package/esm/models/client-document-list.js.map +1 -0
- package/esm/models/client-document.d.ts +70 -0
- package/esm/models/client-document.d.ts.map +1 -0
- package/esm/models/client-document.js +45 -0
- package/esm/models/client-document.js.map +1 -0
- package/esm/models/client-update.d.ts +5 -1
- package/esm/models/client-update.d.ts.map +1 -1
- package/esm/models/client-update.js +5 -1
- package/esm/models/client-update.js.map +1 -1
- package/esm/models/client.d.ts +5 -1
- package/esm/models/client.d.ts.map +1 -1
- package/esm/models/client.js +5 -1
- package/esm/models/client.js.map +1 -1
- package/esm/models/contact.d.ts +1 -1
- package/esm/models/contact.d.ts.map +1 -1
- package/esm/models/contact.js +1 -1
- package/esm/models/contact.js.map +1 -1
- package/esm/models/contract-create.d.ts +0 -5
- package/esm/models/contract-create.d.ts.map +1 -1
- package/esm/models/contract-create.js +0 -1
- package/esm/models/contract-create.js.map +1 -1
- package/esm/models/contract.d.ts +0 -4
- package/esm/models/contract.d.ts.map +1 -1
- package/esm/models/contract.js +0 -1
- package/esm/models/contract.js.map +1 -1
- package/esm/models/form-list.d.ts +13 -0
- package/esm/models/form-list.d.ts.map +1 -0
- package/esm/models/form-list.js +17 -0
- package/esm/models/form-list.js.map +1 -0
- package/esm/models/form-submission-answer.d.ts +12 -0
- package/esm/models/form-submission-answer.d.ts.map +1 -0
- package/esm/models/form-submission-answer.js +16 -0
- package/esm/models/form-submission-answer.js.map +1 -0
- package/esm/models/form-submission-list.d.ts +13 -0
- package/esm/models/form-submission-list.d.ts.map +1 -0
- package/esm/models/form-submission-list.js +16 -0
- package/esm/models/form-submission-list.js.map +1 -0
- package/esm/models/form-submission.d.ts +54 -0
- package/esm/models/form-submission.d.ts.map +1 -0
- package/esm/models/form-submission.js +38 -0
- package/esm/models/form-submission.js.map +1 -0
- package/esm/models/form.d.ts +36 -0
- package/esm/models/form.d.ts.map +1 -0
- package/esm/models/form.js +30 -0
- package/esm/models/form.js.map +1 -0
- package/esm/models/index.d.ts +7 -8
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +7 -8
- package/esm/models/index.js.map +1 -1
- package/esm/models/invoice.d.ts +4 -1
- package/esm/models/invoice.d.ts.map +1 -1
- package/esm/models/invoice.js +1 -1
- package/esm/models/invoice.js.map +1 -1
- package/esm/models/milestone-create.d.ts +1 -1
- package/esm/models/milestone-create.js +1 -1
- package/esm/models/milestone-create.js.map +1 -1
- package/esm/models/milestone.d.ts +1 -1
- package/esm/models/milestone.js +1 -1
- package/esm/models/milestone.js.map +1 -1
- package/esm/models/operations/get-client-document.d.ts +27 -0
- package/esm/models/operations/get-client-document.d.ts.map +1 -0
- package/esm/models/operations/get-client-document.js +20 -0
- package/esm/models/operations/get-client-document.js.map +1 -0
- package/esm/models/operations/get-form-submission.d.ts +27 -0
- package/esm/models/operations/get-form-submission.d.ts.map +1 -0
- package/esm/models/operations/get-form-submission.js +20 -0
- package/esm/models/operations/get-form-submission.js.map +1 -0
- package/esm/models/operations/get-form.d.ts +27 -0
- package/esm/models/operations/get-form.d.ts.map +1 -0
- package/esm/models/operations/get-form.js +20 -0
- package/esm/models/operations/get-form.js.map +1 -0
- package/esm/models/operations/index.d.ts +6 -10
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +6 -10
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-catalog-items.d.ts +9 -0
- package/esm/models/operations/list-catalog-items.d.ts.map +1 -1
- package/esm/models/operations/list-catalog-items.js +8 -0
- package/esm/models/operations/list-catalog-items.js.map +1 -1
- package/esm/models/operations/list-client-documents.d.ts +61 -0
- package/esm/models/operations/list-client-documents.d.ts.map +1 -0
- package/esm/models/operations/list-client-documents.js +50 -0
- package/esm/models/operations/list-client-documents.js.map +1 -0
- package/esm/models/operations/list-clients.d.ts +5 -1
- package/esm/models/operations/list-clients.d.ts.map +1 -1
- package/esm/models/operations/list-clients.js +5 -1
- package/esm/models/operations/list-clients.js.map +1 -1
- package/esm/models/operations/list-form-submissions.d.ts +64 -0
- package/esm/models/operations/list-form-submissions.d.ts.map +1 -0
- package/esm/models/operations/list-form-submissions.js +51 -0
- package/esm/models/operations/list-form-submissions.js.map +1 -0
- package/esm/models/operations/list-forms.d.ts +47 -0
- package/esm/models/operations/list-forms.d.ts.map +1 -0
- package/esm/models/operations/list-forms.js +43 -0
- package/esm/models/operations/list-forms.js.map +1 -0
- package/esm/models/operations/list-invoices.d.ts +18 -1
- package/esm/models/operations/list-invoices.d.ts.map +1 -1
- package/esm/models/operations/list-invoices.js +10 -1
- package/esm/models/operations/list-invoices.js.map +1 -1
- package/esm/models/operations/list-milestones.d.ts +1 -1
- package/esm/models/operations/list-milestones.js +1 -1
- package/esm/models/operations/list-milestones.js.map +1 -1
- package/esm/models/operations/list-payments.d.ts +4 -4
- package/esm/models/operations/list-payments.d.ts.map +1 -1
- package/esm/models/operations/list-payments.js +3 -3
- package/esm/models/operations/list-payments.js.map +1 -1
- package/esm/models/operations/list-webhooks.d.ts +10 -11
- package/esm/models/operations/list-webhooks.d.ts.map +1 -1
- package/esm/models/operations/list-webhooks.js +10 -11
- package/esm/models/operations/list-webhooks.js.map +1 -1
- package/esm/models/webhook-create.d.ts +10 -11
- package/esm/models/webhook-create.d.ts.map +1 -1
- package/esm/models/webhook-create.js +10 -11
- package/esm/models/webhook-create.js.map +1 -1
- package/esm/models/webhook-update.d.ts +10 -11
- package/esm/models/webhook-update.d.ts.map +1 -1
- package/esm/models/webhook-update.js +10 -11
- package/esm/models/webhook-update.js.map +1 -1
- package/esm/models/webhook.d.ts +10 -11
- package/esm/models/webhook.d.ts.map +1 -1
- package/esm/models/webhook.js +10 -11
- package/esm/models/webhook.js.map +1 -1
- package/esm/sdk/form-submissions.d.ts +20 -0
- package/esm/sdk/form-submissions.d.ts.map +1 -0
- package/esm/sdk/form-submissions.js +26 -0
- package/esm/sdk/form-submissions.js.map +1 -0
- package/esm/sdk/forms-and-agreements.d.ts +17 -0
- package/esm/sdk/forms-and-agreements.d.ts.map +1 -0
- package/esm/sdk/forms-and-agreements.js +23 -0
- package/esm/sdk/forms-and-agreements.js.map +1 -0
- package/esm/sdk/forms.d.ts +17 -0
- package/esm/sdk/forms.d.ts.map +1 -0
- package/esm/sdk/forms.js +23 -0
- package/esm/sdk/forms.js.map +1 -0
- package/esm/sdk/invoices.d.ts +1 -1
- package/esm/sdk/invoices.js +1 -1
- package/esm/sdk/milestones.d.ts +1 -1
- package/esm/sdk/milestones.js +1 -1
- package/esm/sdk/sdk.d.ts +9 -6
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +15 -10
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalog-items-list.ts +1 -0
- package/src/funcs/{proposals-delete.ts → form-submissions-get.ts} +16 -14
- package/src/funcs/form-submissions-list.ts +284 -0
- package/src/funcs/{proposals-get.ts → forms-and-agreements-get.ts} +13 -12
- package/src/funcs/{proposals-list.ts → forms-and-agreements-list.ts} +15 -15
- package/src/funcs/{inquiries-get.ts → forms-get.ts} +13 -13
- package/src/funcs/{inquiries-list.ts → forms-list.ts} +17 -22
- package/src/funcs/invoices-create.ts +1 -1
- package/src/funcs/invoices-list.ts +1 -0
- package/src/funcs/milestones-create.ts +1 -1
- package/src/hooks/types.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +13 -4
- package/src/models/api-error.ts +1 -0
- package/src/models/catalog-item.ts +28 -0
- package/src/models/client-create.ts +5 -1
- package/src/models/client-document-list.ts +40 -0
- package/src/models/client-document.ts +114 -0
- package/src/models/client-update.ts +5 -1
- package/src/models/client.ts +5 -1
- package/src/models/contact.ts +2 -2
- package/src/models/contract-create.ts +0 -6
- package/src/models/contract.ts +0 -5
- package/src/models/{inquiry-list.ts → form-list.ts} +9 -9
- package/src/models/form-submission-answer.ts +35 -0
- package/src/models/form-submission-list.ts +40 -0
- package/src/models/form-submission.ts +99 -0
- package/src/models/form.ts +67 -0
- package/src/models/index.ts +7 -8
- package/src/models/invoice.ts +5 -1
- package/src/models/milestone-create.ts +1 -1
- package/src/models/milestone.ts +1 -1
- package/src/models/operations/get-client-document.ts +61 -0
- package/src/models/operations/get-form-submission.ts +61 -0
- package/src/models/operations/get-form.ts +55 -0
- package/src/models/operations/index.ts +6 -10
- package/src/models/operations/list-catalog-items.ts +13 -0
- package/src/models/operations/list-client-documents.ts +132 -0
- package/src/models/operations/list-clients.ts +5 -1
- package/src/models/operations/list-form-submissions.ts +142 -0
- package/src/models/operations/list-forms.ts +112 -0
- package/src/models/operations/list-invoices.ts +23 -1
- package/src/models/operations/list-milestones.ts +1 -1
- package/src/models/operations/list-payments.ts +7 -5
- package/src/models/operations/list-webhooks.ts +10 -11
- package/src/models/webhook-create.ts +10 -11
- package/src/models/webhook-update.ts +10 -11
- package/src/models/webhook.ts +10 -11
- package/src/sdk/form-submissions.ts +50 -0
- package/src/sdk/forms-and-agreements.ts +47 -0
- package/src/sdk/forms.ts +45 -0
- package/src/sdk/invoices.ts +1 -1
- package/src/sdk/milestones.ts +1 -1
- package/src/sdk/sdk.ts +18 -12
- package/esm/funcs/inquiries-create.d.ts +0 -19
- package/esm/funcs/inquiries-create.d.ts.map +0 -1
- package/esm/funcs/inquiries-create.js +0 -96
- package/esm/funcs/inquiries-create.js.map +0 -1
- package/esm/funcs/inquiries-delete.d.ts.map +0 -1
- package/esm/funcs/inquiries-delete.js.map +0 -1
- package/esm/funcs/inquiries-get.d.ts.map +0 -1
- package/esm/funcs/inquiries-get.js.map +0 -1
- package/esm/funcs/inquiries-list.d.ts.map +0 -1
- package/esm/funcs/inquiries-list.js.map +0 -1
- package/esm/funcs/inquiries-update.d.ts +0 -19
- package/esm/funcs/inquiries-update.d.ts.map +0 -1
- package/esm/funcs/inquiries-update.js +0 -111
- package/esm/funcs/inquiries-update.js.map +0 -1
- package/esm/funcs/proposals-create.d.ts +0 -19
- package/esm/funcs/proposals-create.d.ts.map +0 -1
- package/esm/funcs/proposals-create.js +0 -96
- package/esm/funcs/proposals-create.js.map +0 -1
- package/esm/funcs/proposals-delete.d.ts +0 -15
- package/esm/funcs/proposals-delete.d.ts.map +0 -1
- package/esm/funcs/proposals-delete.js +0 -106
- package/esm/funcs/proposals-delete.js.map +0 -1
- package/esm/funcs/proposals-get.d.ts.map +0 -1
- package/esm/funcs/proposals-get.js.map +0 -1
- package/esm/funcs/proposals-list.d.ts.map +0 -1
- package/esm/funcs/proposals-list.js.map +0 -1
- package/esm/funcs/proposals-update.d.ts +0 -19
- package/esm/funcs/proposals-update.d.ts.map +0 -1
- package/esm/funcs/proposals-update.js +0 -111
- package/esm/funcs/proposals-update.js.map +0 -1
- package/esm/models/inquiry-create.d.ts +0 -45
- package/esm/models/inquiry-create.d.ts.map +0 -1
- package/esm/models/inquiry-create.js +0 -28
- package/esm/models/inquiry-create.js.map +0 -1
- package/esm/models/inquiry-list.d.ts +0 -13
- package/esm/models/inquiry-list.d.ts.map +0 -1
- package/esm/models/inquiry-list.js +0 -17
- package/esm/models/inquiry-list.js.map +0 -1
- package/esm/models/inquiry-update.d.ts +0 -45
- package/esm/models/inquiry-update.d.ts.map +0 -1
- package/esm/models/inquiry-update.js +0 -29
- package/esm/models/inquiry-update.js.map +0 -1
- package/esm/models/inquiry.d.ts +0 -78
- package/esm/models/inquiry.d.ts.map +0 -1
- package/esm/models/inquiry.js +0 -51
- package/esm/models/inquiry.js.map +0 -1
- package/esm/models/operations/create-inquiry.d.ts +0 -30
- package/esm/models/operations/create-inquiry.d.ts.map +0 -1
- package/esm/models/operations/create-inquiry.js +0 -27
- package/esm/models/operations/create-inquiry.js.map +0 -1
- package/esm/models/operations/create-proposal.d.ts +0 -30
- package/esm/models/operations/create-proposal.d.ts.map +0 -1
- package/esm/models/operations/create-proposal.js +0 -27
- package/esm/models/operations/create-proposal.js.map +0 -1
- package/esm/models/operations/delete-inquiry.d.ts +0 -27
- package/esm/models/operations/delete-inquiry.d.ts.map +0 -1
- package/esm/models/operations/delete-inquiry.js +0 -20
- package/esm/models/operations/delete-inquiry.js.map +0 -1
- package/esm/models/operations/delete-proposal.d.ts +0 -27
- package/esm/models/operations/delete-proposal.d.ts.map +0 -1
- package/esm/models/operations/delete-proposal.js +0 -20
- package/esm/models/operations/delete-proposal.js.map +0 -1
- package/esm/models/operations/get-inquiry.d.ts +0 -27
- package/esm/models/operations/get-inquiry.d.ts.map +0 -1
- package/esm/models/operations/get-inquiry.js +0 -20
- package/esm/models/operations/get-inquiry.js.map +0 -1
- package/esm/models/operations/get-proposal.d.ts +0 -27
- package/esm/models/operations/get-proposal.d.ts.map +0 -1
- package/esm/models/operations/get-proposal.js +0 -20
- package/esm/models/operations/get-proposal.js.map +0 -1
- package/esm/models/operations/list-inquiries.d.ts +0 -60
- package/esm/models/operations/list-inquiries.d.ts.map +0 -1
- package/esm/models/operations/list-inquiries.js +0 -55
- package/esm/models/operations/list-inquiries.js.map +0 -1
- package/esm/models/operations/list-proposals.d.ts +0 -56
- package/esm/models/operations/list-proposals.d.ts.map +0 -1
- package/esm/models/operations/list-proposals.js +0 -48
- package/esm/models/operations/list-proposals.js.map +0 -1
- package/esm/models/operations/update-inquiry.d.ts +0 -30
- package/esm/models/operations/update-inquiry.d.ts.map +0 -1
- package/esm/models/operations/update-inquiry.js +0 -22
- package/esm/models/operations/update-inquiry.js.map +0 -1
- package/esm/models/operations/update-proposal.d.ts +0 -30
- package/esm/models/operations/update-proposal.d.ts.map +0 -1
- package/esm/models/operations/update-proposal.js +0 -22
- package/esm/models/operations/update-proposal.js.map +0 -1
- package/esm/models/proposal-create.d.ts +0 -45
- package/esm/models/proposal-create.d.ts.map +0 -1
- package/esm/models/proposal-create.js +0 -26
- package/esm/models/proposal-create.js.map +0 -1
- package/esm/models/proposal-list.d.ts +0 -13
- package/esm/models/proposal-list.d.ts.map +0 -1
- package/esm/models/proposal-list.js +0 -16
- package/esm/models/proposal-list.js.map +0 -1
- package/esm/models/proposal-update.d.ts +0 -43
- package/esm/models/proposal-update.d.ts.map +0 -1
- package/esm/models/proposal-update.js +0 -27
- package/esm/models/proposal-update.js.map +0 -1
- package/esm/models/proposal.d.ts +0 -70
- package/esm/models/proposal.d.ts.map +0 -1
- package/esm/models/proposal.js +0 -52
- package/esm/models/proposal.js.map +0 -1
- package/esm/sdk/inquiries.d.ts +0 -35
- package/esm/sdk/inquiries.d.ts.map +0 -1
- package/esm/sdk/inquiries.js +0 -50
- package/esm/sdk/inquiries.js.map +0 -1
- package/esm/sdk/proposals.d.ts +0 -35
- package/esm/sdk/proposals.d.ts.map +0 -1
- package/esm/sdk/proposals.js +0 -50
- package/esm/sdk/proposals.js.map +0 -1
- package/src/funcs/inquiries-create.ts +0 -195
- package/src/funcs/inquiries-delete.ts +0 -201
- package/src/funcs/inquiries-update.ts +0 -206
- package/src/funcs/proposals-create.ts +0 -195
- package/src/funcs/proposals-update.ts +0 -206
- package/src/models/inquiry-create.ts +0 -72
- package/src/models/inquiry-update.ts +0 -80
- package/src/models/inquiry.ts +0 -123
- package/src/models/operations/create-inquiry.ts +0 -73
- package/src/models/operations/create-proposal.ts +0 -73
- package/src/models/operations/delete-inquiry.ts +0 -61
- package/src/models/operations/delete-proposal.ts +0 -61
- package/src/models/operations/get-inquiry.ts +0 -61
- package/src/models/operations/get-proposal.ts +0 -61
- package/src/models/operations/list-inquiries.ts +0 -130
- package/src/models/operations/list-proposals.ts +0 -123
- package/src/models/operations/update-inquiry.ts +0 -65
- package/src/models/operations/update-proposal.ts +0 -65
- package/src/models/proposal-create.ts +0 -86
- package/src/models/proposal-list.ts +0 -35
- package/src/models/proposal-update.ts +0 -84
- package/src/models/proposal.ts +0 -120
- package/src/sdk/inquiries.ts +0 -102
- package/src/sdk/proposals.ts +0 -102
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v4-mini";
|
|
6
|
-
import { ClientCasaCore } from "../core.js";
|
|
7
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
-
import * as M from "../lib/matchers.js";
|
|
10
|
-
import { compactMap } from "../lib/primitives.js";
|
|
11
|
-
import { safeParse } from "../lib/schemas.js";
|
|
12
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
14
|
-
import { pathToFunc } from "../lib/url.js";
|
|
15
|
-
import { ClientCasaError } from "../models/errors/client-casa-error.js";
|
|
16
|
-
import {
|
|
17
|
-
ConnectionError,
|
|
18
|
-
InvalidRequestError,
|
|
19
|
-
RequestAbortedError,
|
|
20
|
-
RequestTimeoutError,
|
|
21
|
-
UnexpectedClientError,
|
|
22
|
-
} from "../models/errors/http-client-errors.js";
|
|
23
|
-
import * as errors from "../models/errors/index.js";
|
|
24
|
-
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
-
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
-
import * as models from "../models/index.js";
|
|
27
|
-
import * as operations from "../models/operations/index.js";
|
|
28
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
-
import { Result } from "../types/fp.js";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Create a proposal (metadata only — rich-text content is dashboard-managed)
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* Creates a draft proposal. The narrative content (Tiptap document) and line items are not editable via the v1 API; use the dashboard.
|
|
36
|
-
*/
|
|
37
|
-
export function proposalsCreate(
|
|
38
|
-
client: ClientCasaCore,
|
|
39
|
-
security: operations.CreateProposalSecurity,
|
|
40
|
-
request: operations.CreateProposalRequest,
|
|
41
|
-
options?: RequestOptions,
|
|
42
|
-
): APIPromise<
|
|
43
|
-
Result<
|
|
44
|
-
models.Proposal,
|
|
45
|
-
| errors.ApiError
|
|
46
|
-
| ClientCasaError
|
|
47
|
-
| ResponseValidationError
|
|
48
|
-
| ConnectionError
|
|
49
|
-
| RequestAbortedError
|
|
50
|
-
| RequestTimeoutError
|
|
51
|
-
| InvalidRequestError
|
|
52
|
-
| UnexpectedClientError
|
|
53
|
-
| SDKValidationError
|
|
54
|
-
>
|
|
55
|
-
> {
|
|
56
|
-
return new APIPromise($do(
|
|
57
|
-
client,
|
|
58
|
-
security,
|
|
59
|
-
request,
|
|
60
|
-
options,
|
|
61
|
-
));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function $do(
|
|
65
|
-
client: ClientCasaCore,
|
|
66
|
-
security: operations.CreateProposalSecurity,
|
|
67
|
-
request: operations.CreateProposalRequest,
|
|
68
|
-
options?: RequestOptions,
|
|
69
|
-
): Promise<
|
|
70
|
-
[
|
|
71
|
-
Result<
|
|
72
|
-
models.Proposal,
|
|
73
|
-
| errors.ApiError
|
|
74
|
-
| ClientCasaError
|
|
75
|
-
| ResponseValidationError
|
|
76
|
-
| ConnectionError
|
|
77
|
-
| RequestAbortedError
|
|
78
|
-
| RequestTimeoutError
|
|
79
|
-
| InvalidRequestError
|
|
80
|
-
| UnexpectedClientError
|
|
81
|
-
| SDKValidationError
|
|
82
|
-
>,
|
|
83
|
-
APICall,
|
|
84
|
-
]
|
|
85
|
-
> {
|
|
86
|
-
const parsed = safeParse(
|
|
87
|
-
request,
|
|
88
|
-
(value) => z.parse(operations.CreateProposalRequest$outboundSchema, value),
|
|
89
|
-
"Input validation failed",
|
|
90
|
-
);
|
|
91
|
-
if (!parsed.ok) {
|
|
92
|
-
return [parsed, { status: "invalid" }];
|
|
93
|
-
}
|
|
94
|
-
const payload = parsed.value;
|
|
95
|
-
const body = encodeJSON("body", payload.body, { explode: true });
|
|
96
|
-
|
|
97
|
-
const path = pathToFunc("/api/v1/proposals")();
|
|
98
|
-
|
|
99
|
-
const headers = new Headers(compactMap({
|
|
100
|
-
"Content-Type": "application/json",
|
|
101
|
-
Accept: "application/json",
|
|
102
|
-
"Idempotency-Key": encodeSimple(
|
|
103
|
-
"Idempotency-Key",
|
|
104
|
-
payload["Idempotency-Key"],
|
|
105
|
-
{ explode: false, charEncoding: "none" },
|
|
106
|
-
),
|
|
107
|
-
}));
|
|
108
|
-
|
|
109
|
-
const requestSecurity = resolveSecurity(
|
|
110
|
-
[
|
|
111
|
-
{
|
|
112
|
-
fieldName: "x-api-key",
|
|
113
|
-
type: "apiKey:header",
|
|
114
|
-
value: security?.apiKey,
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
[
|
|
118
|
-
{
|
|
119
|
-
fieldName: "Authorization",
|
|
120
|
-
type: "http:bearer",
|
|
121
|
-
value: security?.bearer,
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const context = {
|
|
127
|
-
options: client._options,
|
|
128
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
129
|
-
operationID: "createProposal",
|
|
130
|
-
oAuth2Scopes: null,
|
|
131
|
-
|
|
132
|
-
resolvedSecurity: requestSecurity,
|
|
133
|
-
|
|
134
|
-
securitySource: security,
|
|
135
|
-
retryConfig: options?.retries
|
|
136
|
-
|| client._options.retryConfig
|
|
137
|
-
|| { strategy: "none" },
|
|
138
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const requestRes = client._createRequest(context, {
|
|
142
|
-
security: requestSecurity,
|
|
143
|
-
method: "POST",
|
|
144
|
-
baseURL: options?.serverURL,
|
|
145
|
-
path: path,
|
|
146
|
-
headers: headers,
|
|
147
|
-
body: body,
|
|
148
|
-
userAgent: client._options.userAgent,
|
|
149
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
150
|
-
}, options);
|
|
151
|
-
if (!requestRes.ok) {
|
|
152
|
-
return [requestRes, { status: "invalid" }];
|
|
153
|
-
}
|
|
154
|
-
const req = requestRes.value;
|
|
155
|
-
|
|
156
|
-
const doResult = await client._do(req, {
|
|
157
|
-
context,
|
|
158
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
159
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
160
|
-
retryConfig: context.retryConfig,
|
|
161
|
-
retryCodes: context.retryCodes,
|
|
162
|
-
});
|
|
163
|
-
if (!doResult.ok) {
|
|
164
|
-
return [doResult, { status: "request-error", request: req }];
|
|
165
|
-
}
|
|
166
|
-
const response = doResult.value;
|
|
167
|
-
|
|
168
|
-
const responseFields = {
|
|
169
|
-
HttpMeta: { Response: response, Request: req },
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const [result] = await M.match<
|
|
173
|
-
models.Proposal,
|
|
174
|
-
| errors.ApiError
|
|
175
|
-
| ClientCasaError
|
|
176
|
-
| ResponseValidationError
|
|
177
|
-
| ConnectionError
|
|
178
|
-
| RequestAbortedError
|
|
179
|
-
| RequestTimeoutError
|
|
180
|
-
| InvalidRequestError
|
|
181
|
-
| UnexpectedClientError
|
|
182
|
-
| SDKValidationError
|
|
183
|
-
>(
|
|
184
|
-
M.json(201, models.Proposal$inboundSchema),
|
|
185
|
-
M.jsonErr([400, 401, 403, 409, 429], errors.ApiError$inboundSchema),
|
|
186
|
-
M.jsonErr(500, errors.ApiError$inboundSchema),
|
|
187
|
-
M.fail("4XX"),
|
|
188
|
-
M.fail("5XX"),
|
|
189
|
-
)(response, req, { extraFields: responseFields });
|
|
190
|
-
if (!result.ok) {
|
|
191
|
-
return [result, { status: "complete", request: req, response }];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return [result, { status: "complete", request: req, response }];
|
|
195
|
-
}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v4-mini";
|
|
6
|
-
import { ClientCasaCore } from "../core.js";
|
|
7
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
-
import * as M from "../lib/matchers.js";
|
|
10
|
-
import { compactMap } from "../lib/primitives.js";
|
|
11
|
-
import { safeParse } from "../lib/schemas.js";
|
|
12
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
14
|
-
import { pathToFunc } from "../lib/url.js";
|
|
15
|
-
import { ClientCasaError } from "../models/errors/client-casa-error.js";
|
|
16
|
-
import {
|
|
17
|
-
ConnectionError,
|
|
18
|
-
InvalidRequestError,
|
|
19
|
-
RequestAbortedError,
|
|
20
|
-
RequestTimeoutError,
|
|
21
|
-
UnexpectedClientError,
|
|
22
|
-
} from "../models/errors/http-client-errors.js";
|
|
23
|
-
import * as errors from "../models/errors/index.js";
|
|
24
|
-
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
-
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
-
import * as models from "../models/index.js";
|
|
27
|
-
import * as operations from "../models/operations/index.js";
|
|
28
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
-
import { Result } from "../types/fp.js";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Update a proposal
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* Status transitions to `accepted`/`rejected`/`expired` are system-driven; do not set them directly.
|
|
36
|
-
*/
|
|
37
|
-
export function proposalsUpdate(
|
|
38
|
-
client: ClientCasaCore,
|
|
39
|
-
security: operations.UpdateProposalSecurity,
|
|
40
|
-
request: operations.UpdateProposalRequest,
|
|
41
|
-
options?: RequestOptions,
|
|
42
|
-
): APIPromise<
|
|
43
|
-
Result<
|
|
44
|
-
models.Proposal,
|
|
45
|
-
| errors.ApiError
|
|
46
|
-
| ClientCasaError
|
|
47
|
-
| ResponseValidationError
|
|
48
|
-
| ConnectionError
|
|
49
|
-
| RequestAbortedError
|
|
50
|
-
| RequestTimeoutError
|
|
51
|
-
| InvalidRequestError
|
|
52
|
-
| UnexpectedClientError
|
|
53
|
-
| SDKValidationError
|
|
54
|
-
>
|
|
55
|
-
> {
|
|
56
|
-
return new APIPromise($do(
|
|
57
|
-
client,
|
|
58
|
-
security,
|
|
59
|
-
request,
|
|
60
|
-
options,
|
|
61
|
-
));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function $do(
|
|
65
|
-
client: ClientCasaCore,
|
|
66
|
-
security: operations.UpdateProposalSecurity,
|
|
67
|
-
request: operations.UpdateProposalRequest,
|
|
68
|
-
options?: RequestOptions,
|
|
69
|
-
): Promise<
|
|
70
|
-
[
|
|
71
|
-
Result<
|
|
72
|
-
models.Proposal,
|
|
73
|
-
| errors.ApiError
|
|
74
|
-
| ClientCasaError
|
|
75
|
-
| ResponseValidationError
|
|
76
|
-
| ConnectionError
|
|
77
|
-
| RequestAbortedError
|
|
78
|
-
| RequestTimeoutError
|
|
79
|
-
| InvalidRequestError
|
|
80
|
-
| UnexpectedClientError
|
|
81
|
-
| SDKValidationError
|
|
82
|
-
>,
|
|
83
|
-
APICall,
|
|
84
|
-
]
|
|
85
|
-
> {
|
|
86
|
-
const parsed = safeParse(
|
|
87
|
-
request,
|
|
88
|
-
(value) => z.parse(operations.UpdateProposalRequest$outboundSchema, value),
|
|
89
|
-
"Input validation failed",
|
|
90
|
-
);
|
|
91
|
-
if (!parsed.ok) {
|
|
92
|
-
return [parsed, { status: "invalid" }];
|
|
93
|
-
}
|
|
94
|
-
const payload = parsed.value;
|
|
95
|
-
const body = encodeJSON("body", payload.body, { explode: true });
|
|
96
|
-
|
|
97
|
-
const pathParams = {
|
|
98
|
-
id: encodeSimple("id", payload.id, {
|
|
99
|
-
explode: false,
|
|
100
|
-
charEncoding: "percent",
|
|
101
|
-
}),
|
|
102
|
-
};
|
|
103
|
-
const path = pathToFunc("/api/v1/proposals/{id}")(pathParams);
|
|
104
|
-
|
|
105
|
-
const headers = new Headers(compactMap({
|
|
106
|
-
"Content-Type": "application/json",
|
|
107
|
-
Accept: "application/json",
|
|
108
|
-
}));
|
|
109
|
-
|
|
110
|
-
const requestSecurity = resolveSecurity(
|
|
111
|
-
[
|
|
112
|
-
{
|
|
113
|
-
fieldName: "x-api-key",
|
|
114
|
-
type: "apiKey:header",
|
|
115
|
-
value: security?.apiKey,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
[
|
|
119
|
-
{
|
|
120
|
-
fieldName: "Authorization",
|
|
121
|
-
type: "http:bearer",
|
|
122
|
-
value: security?.bearer,
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
const context = {
|
|
128
|
-
options: client._options,
|
|
129
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
130
|
-
operationID: "updateProposal",
|
|
131
|
-
oAuth2Scopes: null,
|
|
132
|
-
|
|
133
|
-
resolvedSecurity: requestSecurity,
|
|
134
|
-
|
|
135
|
-
securitySource: security,
|
|
136
|
-
retryConfig: options?.retries
|
|
137
|
-
|| client._options.retryConfig
|
|
138
|
-
|| {
|
|
139
|
-
strategy: "backoff",
|
|
140
|
-
backoff: {
|
|
141
|
-
initialInterval: 500,
|
|
142
|
-
maxInterval: 30000,
|
|
143
|
-
exponent: 1.5,
|
|
144
|
-
maxElapsedTime: 30000,
|
|
145
|
-
},
|
|
146
|
-
retryConnectionErrors: true,
|
|
147
|
-
}
|
|
148
|
-
|| { strategy: "none" },
|
|
149
|
-
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const requestRes = client._createRequest(context, {
|
|
153
|
-
security: requestSecurity,
|
|
154
|
-
method: "PATCH",
|
|
155
|
-
baseURL: options?.serverURL,
|
|
156
|
-
path: path,
|
|
157
|
-
headers: headers,
|
|
158
|
-
body: body,
|
|
159
|
-
userAgent: client._options.userAgent,
|
|
160
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
161
|
-
}, options);
|
|
162
|
-
if (!requestRes.ok) {
|
|
163
|
-
return [requestRes, { status: "invalid" }];
|
|
164
|
-
}
|
|
165
|
-
const req = requestRes.value;
|
|
166
|
-
|
|
167
|
-
const doResult = await client._do(req, {
|
|
168
|
-
context,
|
|
169
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
170
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
171
|
-
retryConfig: context.retryConfig,
|
|
172
|
-
retryCodes: context.retryCodes,
|
|
173
|
-
});
|
|
174
|
-
if (!doResult.ok) {
|
|
175
|
-
return [doResult, { status: "request-error", request: req }];
|
|
176
|
-
}
|
|
177
|
-
const response = doResult.value;
|
|
178
|
-
|
|
179
|
-
const responseFields = {
|
|
180
|
-
HttpMeta: { Response: response, Request: req },
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const [result] = await M.match<
|
|
184
|
-
models.Proposal,
|
|
185
|
-
| errors.ApiError
|
|
186
|
-
| ClientCasaError
|
|
187
|
-
| ResponseValidationError
|
|
188
|
-
| ConnectionError
|
|
189
|
-
| RequestAbortedError
|
|
190
|
-
| RequestTimeoutError
|
|
191
|
-
| InvalidRequestError
|
|
192
|
-
| UnexpectedClientError
|
|
193
|
-
| SDKValidationError
|
|
194
|
-
>(
|
|
195
|
-
M.json(200, models.Proposal$inboundSchema),
|
|
196
|
-
M.jsonErr([400, 401, 403, 404, 429], errors.ApiError$inboundSchema),
|
|
197
|
-
M.jsonErr(500, errors.ApiError$inboundSchema),
|
|
198
|
-
M.fail("4XX"),
|
|
199
|
-
M.fail("5XX"),
|
|
200
|
-
)(response, req, { extraFields: responseFields });
|
|
201
|
-
if (!result.ok) {
|
|
202
|
-
return [result, { status: "complete", request: req, response }];
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return [result, { status: "complete", request: req, response }];
|
|
206
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v4-mini";
|
|
6
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
-
|
|
8
|
-
export const InquiryCreateSource = {
|
|
9
|
-
InquiryForm: "inquiry_form",
|
|
10
|
-
Manual: "manual",
|
|
11
|
-
Referral: "referral",
|
|
12
|
-
Other: "other",
|
|
13
|
-
} as const;
|
|
14
|
-
export type InquiryCreateSource = ClosedEnum<typeof InquiryCreateSource>;
|
|
15
|
-
|
|
16
|
-
export type InquiryCreate = {
|
|
17
|
-
name: string;
|
|
18
|
-
email: string;
|
|
19
|
-
phone?: string | undefined;
|
|
20
|
-
preferredDate?: Date | undefined;
|
|
21
|
-
message?: string | undefined;
|
|
22
|
-
source?: InquiryCreateSource | undefined;
|
|
23
|
-
customAnswers?: { [k: string]: any } | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* UUID v4
|
|
26
|
-
*/
|
|
27
|
-
contactId?: string | undefined;
|
|
28
|
-
notes?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/** @internal */
|
|
32
|
-
export const InquiryCreateSource$outboundSchema: z.ZodMiniEnum<
|
|
33
|
-
typeof InquiryCreateSource
|
|
34
|
-
> = z.enum(InquiryCreateSource);
|
|
35
|
-
|
|
36
|
-
/** @internal */
|
|
37
|
-
export type InquiryCreate$Outbound = {
|
|
38
|
-
name: string;
|
|
39
|
-
email: string;
|
|
40
|
-
phone?: string | undefined;
|
|
41
|
-
preferredDate?: string | undefined;
|
|
42
|
-
message?: string | undefined;
|
|
43
|
-
source: string;
|
|
44
|
-
customAnswers?: { [k: string]: any } | undefined;
|
|
45
|
-
contactId?: string | undefined;
|
|
46
|
-
notes?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const InquiryCreate$outboundSchema: z.ZodMiniType<
|
|
51
|
-
InquiryCreate$Outbound,
|
|
52
|
-
InquiryCreate
|
|
53
|
-
> = z.object({
|
|
54
|
-
name: z.string(),
|
|
55
|
-
email: z.string(),
|
|
56
|
-
phone: z.optional(z.string()),
|
|
57
|
-
preferredDate: z.optional(
|
|
58
|
-
z.pipe(
|
|
59
|
-
z.date(),
|
|
60
|
-
z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
|
|
61
|
-
),
|
|
62
|
-
),
|
|
63
|
-
message: z.optional(z.string()),
|
|
64
|
-
source: z._default(InquiryCreateSource$outboundSchema, "manual"),
|
|
65
|
-
customAnswers: z.optional(z.record(z.string(), z.any())),
|
|
66
|
-
contactId: z.optional(z.string()),
|
|
67
|
-
notes: z.optional(z.string()),
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export function inquiryCreateToJSON(inquiryCreate: InquiryCreate): string {
|
|
71
|
-
return JSON.stringify(InquiryCreate$outboundSchema.parse(inquiryCreate));
|
|
72
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v4-mini";
|
|
6
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
-
|
|
8
|
-
export const InquiryUpdateStatus = {
|
|
9
|
-
New: "new",
|
|
10
|
-
Contacted: "contacted",
|
|
11
|
-
Qualified: "qualified",
|
|
12
|
-
Declined: "declined",
|
|
13
|
-
Spam: "spam",
|
|
14
|
-
} as const;
|
|
15
|
-
export type InquiryUpdateStatus = ClosedEnum<typeof InquiryUpdateStatus>;
|
|
16
|
-
|
|
17
|
-
export type InquiryUpdate = {
|
|
18
|
-
status?: InquiryUpdateStatus | undefined;
|
|
19
|
-
name?: string | undefined;
|
|
20
|
-
email?: string | null | undefined;
|
|
21
|
-
phone?: string | null | undefined;
|
|
22
|
-
preferredDate?: Date | null | undefined;
|
|
23
|
-
message?: string | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* ISO 8601 timestamp (UTC)
|
|
26
|
-
*/
|
|
27
|
-
lastContactedAt?: Date | null | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* ISO 8601 timestamp (UTC)
|
|
30
|
-
*/
|
|
31
|
-
nextFollowUpAt?: Date | null | undefined;
|
|
32
|
-
notes?: string | null | undefined;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/** @internal */
|
|
36
|
-
export const InquiryUpdateStatus$outboundSchema: z.ZodMiniEnum<
|
|
37
|
-
typeof InquiryUpdateStatus
|
|
38
|
-
> = z.enum(InquiryUpdateStatus);
|
|
39
|
-
|
|
40
|
-
/** @internal */
|
|
41
|
-
export type InquiryUpdate$Outbound = {
|
|
42
|
-
status?: string | undefined;
|
|
43
|
-
name?: string | undefined;
|
|
44
|
-
email?: string | null | undefined;
|
|
45
|
-
phone?: string | null | undefined;
|
|
46
|
-
preferredDate?: string | null | undefined;
|
|
47
|
-
message?: string | null | undefined;
|
|
48
|
-
lastContactedAt?: string | null | undefined;
|
|
49
|
-
nextFollowUpAt?: string | null | undefined;
|
|
50
|
-
notes?: string | null | undefined;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const InquiryUpdate$outboundSchema: z.ZodMiniType<
|
|
55
|
-
InquiryUpdate$Outbound,
|
|
56
|
-
InquiryUpdate
|
|
57
|
-
> = z.object({
|
|
58
|
-
status: z.optional(InquiryUpdateStatus$outboundSchema),
|
|
59
|
-
name: z.optional(z.string()),
|
|
60
|
-
email: z.optional(z.nullable(z.string())),
|
|
61
|
-
phone: z.optional(z.nullable(z.string())),
|
|
62
|
-
preferredDate: z.optional(
|
|
63
|
-
z.nullable(z.pipe(
|
|
64
|
-
z.date(),
|
|
65
|
-
z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
|
|
66
|
-
)),
|
|
67
|
-
),
|
|
68
|
-
message: z.optional(z.nullable(z.string())),
|
|
69
|
-
lastContactedAt: z.optional(
|
|
70
|
-
z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
71
|
-
),
|
|
72
|
-
nextFollowUpAt: z.optional(
|
|
73
|
-
z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
74
|
-
),
|
|
75
|
-
notes: z.optional(z.nullable(z.string())),
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
export function inquiryUpdateToJSON(inquiryUpdate: InquiryUpdate): string {
|
|
79
|
-
return JSON.stringify(InquiryUpdate$outboundSchema.parse(inquiryUpdate));
|
|
80
|
-
}
|
package/src/models/inquiry.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
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 InquiryStatus = {
|
|
14
|
-
New: "new",
|
|
15
|
-
Contacted: "contacted",
|
|
16
|
-
Qualified: "qualified",
|
|
17
|
-
Converted: "converted",
|
|
18
|
-
Declined: "declined",
|
|
19
|
-
Spam: "spam",
|
|
20
|
-
} as const;
|
|
21
|
-
export type InquiryStatus = OpenEnum<typeof InquiryStatus>;
|
|
22
|
-
|
|
23
|
-
export const InquirySource = {
|
|
24
|
-
InquiryForm: "inquiry_form",
|
|
25
|
-
Manual: "manual",
|
|
26
|
-
Referral: "referral",
|
|
27
|
-
Other: "other",
|
|
28
|
-
} as const;
|
|
29
|
-
export type InquirySource = OpenEnum<typeof InquirySource>;
|
|
30
|
-
|
|
31
|
-
export type Inquiry = {
|
|
32
|
-
/**
|
|
33
|
-
* UUID v4
|
|
34
|
-
*/
|
|
35
|
-
id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
email: string | null;
|
|
38
|
-
phone: string | null;
|
|
39
|
-
/**
|
|
40
|
-
* UUID v4
|
|
41
|
-
*/
|
|
42
|
-
contactId: string | null;
|
|
43
|
-
inquirySlug: string | null;
|
|
44
|
-
preferredDate: Date | null;
|
|
45
|
-
message: string | null;
|
|
46
|
-
status: InquiryStatus;
|
|
47
|
-
source: InquirySource;
|
|
48
|
-
customAnswers: { [k: string]: any } | null;
|
|
49
|
-
/**
|
|
50
|
-
* UUID v4
|
|
51
|
-
*/
|
|
52
|
-
convertedClientId: string | null;
|
|
53
|
-
/**
|
|
54
|
-
* UUID v4
|
|
55
|
-
*/
|
|
56
|
-
convertedProjectId: string | null;
|
|
57
|
-
/**
|
|
58
|
-
* ISO 8601 timestamp (UTC)
|
|
59
|
-
*/
|
|
60
|
-
convertedAt: Date | null;
|
|
61
|
-
/**
|
|
62
|
-
* ISO 8601 timestamp (UTC)
|
|
63
|
-
*/
|
|
64
|
-
lastContactedAt: Date | null;
|
|
65
|
-
/**
|
|
66
|
-
* ISO 8601 timestamp (UTC)
|
|
67
|
-
*/
|
|
68
|
-
nextFollowUpAt: Date | null;
|
|
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 InquiryStatus$inboundSchema: z.ZodMiniType<
|
|
82
|
-
InquiryStatus,
|
|
83
|
-
unknown
|
|
84
|
-
> = openEnums.inboundSchema(InquiryStatus);
|
|
85
|
-
|
|
86
|
-
/** @internal */
|
|
87
|
-
export const InquirySource$inboundSchema: z.ZodMiniType<
|
|
88
|
-
InquirySource,
|
|
89
|
-
unknown
|
|
90
|
-
> = openEnums.inboundSchema(InquirySource);
|
|
91
|
-
|
|
92
|
-
/** @internal */
|
|
93
|
-
export const Inquiry$inboundSchema: z.ZodMiniType<Inquiry, unknown> = z.object({
|
|
94
|
-
id: types.string(),
|
|
95
|
-
name: types.string(),
|
|
96
|
-
email: types.nullable(types.string()),
|
|
97
|
-
phone: types.nullable(types.string()),
|
|
98
|
-
contactId: types.nullable(types.string()),
|
|
99
|
-
inquirySlug: types.nullable(types.string()),
|
|
100
|
-
preferredDate: types.nullable(types.date()),
|
|
101
|
-
message: types.nullable(types.string()),
|
|
102
|
-
status: InquiryStatus$inboundSchema,
|
|
103
|
-
source: InquirySource$inboundSchema,
|
|
104
|
-
customAnswers: types.nullable(z.record(z.string(), z.any())),
|
|
105
|
-
convertedClientId: types.nullable(types.string()),
|
|
106
|
-
convertedProjectId: types.nullable(types.string()),
|
|
107
|
-
convertedAt: types.nullable(types.date()),
|
|
108
|
-
lastContactedAt: types.nullable(types.date()),
|
|
109
|
-
nextFollowUpAt: types.nullable(types.date()),
|
|
110
|
-
notes: types.nullable(types.string()),
|
|
111
|
-
createdAt: types.date(),
|
|
112
|
-
updatedAt: types.date(),
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export function inquiryFromJSON(
|
|
116
|
-
jsonString: string,
|
|
117
|
-
): SafeParseResult<Inquiry, SDKValidationError> {
|
|
118
|
-
return safeParse(
|
|
119
|
-
jsonString,
|
|
120
|
-
(x) => Inquiry$inboundSchema.parse(JSON.parse(x)),
|
|
121
|
-
`Failed to parse 'Inquiry' from JSON`,
|
|
122
|
-
);
|
|
123
|
-
}
|