contiguity 0.0.9 → 0.1.0
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/LICENSE.md +8 -0
- package/dist/.DS_Store +0 -0
- package/dist/client/fetch.d.ts +25 -0
- package/dist/client/fetch.d.ts.map +1 -0
- package/dist/client/fetch.js +85 -0
- package/dist/contiguity.d.ts +81 -0
- package/dist/contiguity.d.ts.map +1 -0
- package/dist/contiguity.js +106 -0
- package/dist/index.d.ts +29 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12482 -4
- package/dist/services/domains/delete.d.ts +28 -0
- package/dist/services/domains/delete.d.ts.map +1 -0
- package/dist/services/domains/delete.js +37 -0
- package/dist/services/domains/get.d.ts +98 -0
- package/dist/services/domains/get.d.ts.map +1 -0
- package/dist/services/domains/get.js +89 -0
- package/dist/services/domains/index.d.ts +34 -0
- package/dist/services/domains/index.d.ts.map +1 -0
- package/dist/services/domains/index.js +37 -0
- package/dist/services/domains/list.d.ts +36 -0
- package/dist/services/domains/list.d.ts.map +1 -0
- package/dist/services/domains/list.js +42 -0
- package/dist/services/domains/register.d.ts +67 -0
- package/dist/services/domains/register.d.ts.map +1 -0
- package/dist/services/domains/register.js +67 -0
- package/dist/services/email/index.d.ts +17 -0
- package/dist/services/email/index.d.ts.map +1 -0
- package/dist/services/email/index.js +16 -0
- package/dist/services/email/send.d.ts +66 -0
- package/dist/services/email/send.d.ts.map +1 -0
- package/dist/services/email/send.js +78 -0
- package/dist/services/imessage/available.d.ts +14 -0
- package/dist/services/imessage/available.d.ts.map +1 -0
- package/dist/services/imessage/available.js +23 -0
- package/dist/services/imessage/index.d.ts +31 -0
- package/dist/services/imessage/index.d.ts.map +1 -0
- package/dist/services/imessage/index.js +30 -0
- package/dist/services/imessage/send.d.ts +57 -0
- package/dist/services/imessage/send.d.ts.map +1 -0
- package/dist/services/imessage/send.js +60 -0
- package/dist/services/imessage/typing.d.ts +40 -0
- package/dist/services/imessage/typing.d.ts.map +1 -0
- package/dist/services/imessage/typing.js +49 -0
- package/dist/services/lease/available.d.ts +193 -0
- package/dist/services/lease/available.d.ts.map +1 -0
- package/dist/services/lease/available.js +103 -0
- package/dist/services/lease/configure.d.ts +38 -0
- package/dist/services/lease/configure.d.ts.map +1 -0
- package/dist/services/lease/configure.js +40 -0
- package/dist/services/lease/create.d.ts +108 -0
- package/dist/services/lease/create.d.ts.map +1 -0
- package/dist/services/lease/create.js +78 -0
- package/dist/services/lease/details.d.ts +133 -0
- package/dist/services/lease/details.d.ts.map +1 -0
- package/dist/services/lease/details.js +65 -0
- package/dist/services/lease/get.d.ts +96 -0
- package/dist/services/lease/get.d.ts.map +1 -0
- package/dist/services/lease/get.js +68 -0
- package/dist/services/lease/index.d.ts +57 -0
- package/dist/services/lease/index.d.ts.map +1 -0
- package/dist/services/lease/index.js +58 -0
- package/dist/services/lease/leased.d.ts +228 -0
- package/dist/services/lease/leased.d.ts.map +1 -0
- package/dist/services/lease/leased.js +108 -0
- package/dist/services/lease/terminate.d.ts +71 -0
- package/dist/services/lease/terminate.d.ts.map +1 -0
- package/dist/services/lease/terminate.js +78 -0
- package/dist/services/otp/index.d.ts +33 -0
- package/dist/services/otp/index.d.ts.map +1 -0
- package/dist/services/otp/index.js +37 -0
- package/dist/services/otp/new.d.ts +29 -0
- package/dist/services/otp/new.d.ts.map +1 -0
- package/dist/services/otp/new.js +44 -0
- package/dist/services/otp/resend.d.ts +22 -0
- package/dist/services/otp/resend.d.ts.map +1 -0
- package/dist/services/otp/resend.js +31 -0
- package/dist/services/otp/send.d.ts +26 -0
- package/dist/services/otp/send.d.ts.map +1 -0
- package/dist/services/otp/send.js +38 -0
- package/dist/services/otp/verify.d.ts +24 -0
- package/dist/services/otp/verify.d.ts.map +1 -0
- package/dist/services/otp/verify.js +34 -0
- package/dist/services/text/index.d.ts +17 -0
- package/dist/services/text/index.d.ts.map +1 -0
- package/dist/services/text/index.js +16 -0
- package/dist/services/text/send.d.ts +25 -0
- package/dist/services/text/send.d.ts.map +1 -0
- package/dist/services/text/send.js +37 -0
- package/dist/services/whatsapp/index.d.ts +24 -0
- package/dist/services/whatsapp/index.d.ts.map +1 -0
- package/dist/services/whatsapp/index.js +23 -0
- package/dist/services/whatsapp/send.d.ts +57 -0
- package/dist/services/whatsapp/send.d.ts.map +1 -0
- package/dist/services/whatsapp/send.js +60 -0
- package/dist/services/whatsapp/typing.d.ts +40 -0
- package/dist/services/whatsapp/typing.d.ts.map +1 -0
- package/dist/services/whatsapp/typing.js +49 -0
- package/dist/types/base.d.ts +17 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +20 -0
- package/dist/types/common.d.ts +56 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +48 -0
- package/dist/types/error.d.ts +37 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +54 -0
- package/dist/types/metadata.d.ts +10 -0
- package/dist/types/metadata.d.ts.map +1 -0
- package/dist/types/response.d.ts +10 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +10 -0
- package/dist/utils/parse.d.ts +8 -0
- package/dist/utils/parse.d.ts.map +1 -0
- package/dist/utils/parse.js +36 -0
- package/dist/utils/request.d.ts +5 -27
- package/dist/utils/request.d.ts.map +1 -1
- package/dist/utils/request.js +45 -39
- package/package.json +33 -30
- package/dist/cjs/client.d.ts +0 -27
- package/dist/cjs/client.d.ts.map +0 -1
- package/dist/cjs/client.js +0 -43
- package/dist/cjs/index.d.ts +0 -13
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/resources/conversations.d.ts +0 -30
- package/dist/cjs/resources/conversations.d.ts.map +0 -1
- package/dist/cjs/resources/conversations.js +0 -24
- package/dist/cjs/resources/domains.d.ts +0 -39
- package/dist/cjs/resources/domains.d.ts.map +0 -1
- package/dist/cjs/resources/domains.js +0 -28
- package/dist/cjs/resources/email.d.ts +0 -17
- package/dist/cjs/resources/email.d.ts.map +0 -1
- package/dist/cjs/resources/email.js +0 -19
- package/dist/cjs/resources/imessage.d.ts +0 -49
- package/dist/cjs/resources/imessage.d.ts.map +0 -1
- package/dist/cjs/resources/imessage.js +0 -42
- package/dist/cjs/resources/lease.d.ts +0 -55
- package/dist/cjs/resources/lease.d.ts.map +0 -1
- package/dist/cjs/resources/lease.js +0 -34
- package/dist/cjs/resources/otp.d.ts +0 -63
- package/dist/cjs/resources/otp.d.ts.map +0 -1
- package/dist/cjs/resources/otp.js +0 -48
- package/dist/cjs/resources/text.d.ts +0 -17
- package/dist/cjs/resources/text.d.ts.map +0 -1
- package/dist/cjs/resources/text.js +0 -19
- package/dist/cjs/resources/voice.d.ts +0 -129
- package/dist/cjs/resources/voice.d.ts.map +0 -1
- package/dist/cjs/resources/voice.js +0 -95
- package/dist/cjs/resources/webhook.d.ts +0 -21
- package/dist/cjs/resources/webhook.d.ts.map +0 -1
- package/dist/cjs/resources/webhook.js +0 -47
- package/dist/cjs/resources/whatsapp.d.ts +0 -33
- package/dist/cjs/resources/whatsapp.d.ts.map +0 -1
- package/dist/cjs/resources/whatsapp.js +0 -32
- package/dist/cjs/schemas/conversations.d.ts +0 -5
- package/dist/cjs/schemas/conversations.d.ts.map +0 -1
- package/dist/cjs/schemas/conversations.js +0 -5
- package/dist/cjs/schemas/domains.d.ts +0 -7
- package/dist/cjs/schemas/domains.d.ts.map +0 -1
- package/dist/cjs/schemas/domains.js +0 -10
- package/dist/cjs/schemas/email.d.ts +0 -16
- package/dist/cjs/schemas/email.d.ts.map +0 -1
- package/dist/cjs/schemas/email.js +0 -16
- package/dist/cjs/schemas/imessage.d.ts +0 -25
- package/dist/cjs/schemas/imessage.d.ts.map +0 -1
- package/dist/cjs/schemas/imessage.js +0 -25
- package/dist/cjs/schemas/index.d.ts +0 -10
- package/dist/cjs/schemas/index.d.ts.map +0 -1
- package/dist/cjs/schemas/index.js +0 -25
- package/dist/cjs/schemas/leases.d.ts +0 -9
- package/dist/cjs/schemas/leases.d.ts.map +0 -1
- package/dist/cjs/schemas/leases.js +0 -9
- package/dist/cjs/schemas/otp.d.ts +0 -25
- package/dist/cjs/schemas/otp.d.ts.map +0 -1
- package/dist/cjs/schemas/otp.js +0 -16
- package/dist/cjs/schemas/text.d.ts +0 -9
- package/dist/cjs/schemas/text.d.ts.map +0 -1
- package/dist/cjs/schemas/text.js +0 -12
- package/dist/cjs/schemas/voice.d.ts +0 -5
- package/dist/cjs/schemas/voice.d.ts.map +0 -1
- package/dist/cjs/schemas/voice.js +0 -5
- package/dist/cjs/schemas/whatsapp.d.ts +0 -25
- package/dist/cjs/schemas/whatsapp.d.ts.map +0 -1
- package/dist/cjs/schemas/whatsapp.js +0 -25
- package/dist/cjs/types/index.d.ts +0 -3
- package/dist/cjs/types/index.d.ts.map +0 -1
- package/dist/cjs/types/index.js +0 -18
- package/dist/cjs/types/responses.d.ts +0 -8
- package/dist/cjs/types/responses.d.ts.map +0 -1
- package/dist/cjs/types/responses.js +0 -2
- package/dist/cjs/types/webhooks.d.ts +0 -10
- package/dist/cjs/types/webhooks.d.ts.map +0 -1
- package/dist/cjs/types/webhooks.js +0 -2
- package/dist/cjs/utils/errors.d.ts +0 -6
- package/dist/cjs/utils/errors.d.ts.map +0 -1
- package/dist/cjs/utils/errors.js +0 -15
- package/dist/cjs/utils/request.d.ts +0 -27
- package/dist/cjs/utils/request.d.ts.map +0 -1
- package/dist/cjs/utils/request.js +0 -36
- package/dist/cjs/utils/response.d.ts +0 -12
- package/dist/cjs/utils/response.d.ts.map +0 -1
- package/dist/cjs/utils/response.js +0 -12
- package/dist/cjs/webhook/parse.d.ts +0 -6
- package/dist/cjs/webhook/parse.d.ts.map +0 -1
- package/dist/cjs/webhook/parse.js +0 -14
- package/dist/cjs/webhook/verify.d.ts +0 -6
- package/dist/cjs/webhook/verify.d.ts.map +0 -1
- package/dist/cjs/webhook/verify.js +0 -39
- package/dist/client.d.ts +0 -27
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -50
- package/dist/esm/client.d.ts +0 -27
- package/dist/esm/client.d.ts.map +0 -1
- package/dist/esm/client.js +0 -39
- package/dist/esm/index.d.ts +0 -13
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/resources/conversations.d.ts +0 -30
- package/dist/esm/resources/conversations.d.ts.map +0 -1
- package/dist/esm/resources/conversations.js +0 -20
- package/dist/esm/resources/domains.d.ts +0 -39
- package/dist/esm/resources/domains.d.ts.map +0 -1
- package/dist/esm/resources/domains.js +0 -24
- package/dist/esm/resources/email.d.ts +0 -17
- package/dist/esm/resources/email.d.ts.map +0 -1
- package/dist/esm/resources/email.js +0 -15
- package/dist/esm/resources/imessage.d.ts +0 -49
- package/dist/esm/resources/imessage.d.ts.map +0 -1
- package/dist/esm/resources/imessage.js +0 -38
- package/dist/esm/resources/lease.d.ts +0 -55
- package/dist/esm/resources/lease.d.ts.map +0 -1
- package/dist/esm/resources/lease.js +0 -30
- package/dist/esm/resources/otp.d.ts +0 -63
- package/dist/esm/resources/otp.d.ts.map +0 -1
- package/dist/esm/resources/otp.js +0 -44
- package/dist/esm/resources/text.d.ts +0 -17
- package/dist/esm/resources/text.d.ts.map +0 -1
- package/dist/esm/resources/text.js +0 -15
- package/dist/esm/resources/voice.d.ts +0 -129
- package/dist/esm/resources/voice.d.ts.map +0 -1
- package/dist/esm/resources/voice.js +0 -91
- package/dist/esm/resources/webhook.d.ts +0 -21
- package/dist/esm/resources/webhook.d.ts.map +0 -1
- package/dist/esm/resources/webhook.js +0 -43
- package/dist/esm/resources/whatsapp.d.ts +0 -33
- package/dist/esm/resources/whatsapp.d.ts.map +0 -1
- package/dist/esm/resources/whatsapp.js +0 -28
- package/dist/esm/schemas/conversations.d.ts +0 -5
- package/dist/esm/schemas/conversations.d.ts.map +0 -1
- package/dist/esm/schemas/conversations.js +0 -2
- package/dist/esm/schemas/domains.d.ts +0 -7
- package/dist/esm/schemas/domains.d.ts.map +0 -1
- package/dist/esm/schemas/domains.js +0 -7
- package/dist/esm/schemas/email.d.ts +0 -16
- package/dist/esm/schemas/email.d.ts.map +0 -1
- package/dist/esm/schemas/email.js +0 -13
- package/dist/esm/schemas/imessage.d.ts +0 -25
- package/dist/esm/schemas/imessage.d.ts.map +0 -1
- package/dist/esm/schemas/imessage.js +0 -22
- package/dist/esm/schemas/index.d.ts +0 -10
- package/dist/esm/schemas/index.d.ts.map +0 -1
- package/dist/esm/schemas/index.js +0 -9
- package/dist/esm/schemas/leases.d.ts +0 -9
- package/dist/esm/schemas/leases.d.ts.map +0 -1
- package/dist/esm/schemas/leases.js +0 -6
- package/dist/esm/schemas/otp.d.ts +0 -25
- package/dist/esm/schemas/otp.d.ts.map +0 -1
- package/dist/esm/schemas/otp.js +0 -13
- package/dist/esm/schemas/text.d.ts +0 -9
- package/dist/esm/schemas/text.d.ts.map +0 -1
- package/dist/esm/schemas/text.js +0 -9
- package/dist/esm/schemas/voice.d.ts +0 -5
- package/dist/esm/schemas/voice.d.ts.map +0 -1
- package/dist/esm/schemas/voice.js +0 -2
- package/dist/esm/schemas/whatsapp.d.ts +0 -25
- package/dist/esm/schemas/whatsapp.d.ts.map +0 -1
- package/dist/esm/schemas/whatsapp.js +0 -22
- package/dist/esm/types/index.d.ts +0 -3
- package/dist/esm/types/index.d.ts.map +0 -1
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/types/responses.d.ts +0 -8
- package/dist/esm/types/responses.d.ts.map +0 -1
- package/dist/esm/types/webhooks.d.ts +0 -10
- package/dist/esm/types/webhooks.d.ts.map +0 -1
- package/dist/esm/types/webhooks.js +0 -1
- package/dist/esm/utils/errors.d.ts +0 -6
- package/dist/esm/utils/errors.d.ts.map +0 -1
- package/dist/esm/utils/errors.js +0 -11
- package/dist/esm/utils/request.d.ts +0 -27
- package/dist/esm/utils/request.d.ts.map +0 -1
- package/dist/esm/utils/request.js +0 -33
- package/dist/esm/utils/response.d.ts +0 -12
- package/dist/esm/utils/response.d.ts.map +0 -1
- package/dist/esm/utils/response.js +0 -9
- package/dist/esm/webhook/parse.d.ts +0 -6
- package/dist/esm/webhook/parse.d.ts.map +0 -1
- package/dist/esm/webhook/parse.js +0 -11
- package/dist/esm/webhook/verify.d.ts +0 -6
- package/dist/esm/webhook/verify.d.ts.map +0 -1
- package/dist/esm/webhook/verify.js +0 -36
- package/dist/resources/agreements.d.ts +0 -14
- package/dist/resources/agreements.d.ts.map +0 -1
- package/dist/resources/agreements.js +0 -10
- package/dist/resources/conversations.d.ts +0 -31
- package/dist/resources/conversations.d.ts.map +0 -1
- package/dist/resources/conversations.js +0 -21
- package/dist/resources/domains.d.ts +0 -39
- package/dist/resources/domains.d.ts.map +0 -1
- package/dist/resources/domains.js +0 -24
- package/dist/resources/email.d.ts +0 -17
- package/dist/resources/email.d.ts.map +0 -1
- package/dist/resources/email.js +0 -15
- package/dist/resources/entitlements.d.ts +0 -38
- package/dist/resources/entitlements.d.ts.map +0 -1
- package/dist/resources/entitlements.js +0 -19
- package/dist/resources/identity.d.ts +0 -56
- package/dist/resources/identity.d.ts.map +0 -1
- package/dist/resources/identity.js +0 -43
- package/dist/resources/imessage.d.ts +0 -70
- package/dist/resources/imessage.d.ts.map +0 -1
- package/dist/resources/imessage.js +0 -55
- package/dist/resources/lease.d.ts +0 -55
- package/dist/resources/lease.d.ts.map +0 -1
- package/dist/resources/lease.js +0 -30
- package/dist/resources/otp.d.ts +0 -63
- package/dist/resources/otp.d.ts.map +0 -1
- package/dist/resources/otp.js +0 -44
- package/dist/resources/product.d.ts +0 -23
- package/dist/resources/product.d.ts.map +0 -1
- package/dist/resources/product.js +0 -19
- package/dist/resources/text.d.ts +0 -56
- package/dist/resources/text.d.ts.map +0 -1
- package/dist/resources/text.js +0 -41
- package/dist/resources/voice.d.ts +0 -129
- package/dist/resources/voice.d.ts.map +0 -1
- package/dist/resources/voice.js +0 -91
- package/dist/resources/webhook.d.ts +0 -21
- package/dist/resources/webhook.d.ts.map +0 -1
- package/dist/resources/webhook.js +0 -43
- package/dist/resources/whatsapp.d.ts +0 -45
- package/dist/resources/whatsapp.d.ts.map +0 -1
- package/dist/resources/whatsapp.js +0 -39
- package/dist/schemas/conversations.d.ts +0 -8
- package/dist/schemas/conversations.d.ts.map +0 -1
- package/dist/schemas/conversations.js +0 -8
- package/dist/schemas/domains.d.ts +0 -7
- package/dist/schemas/domains.d.ts.map +0 -1
- package/dist/schemas/domains.js +0 -7
- package/dist/schemas/email.d.ts +0 -16
- package/dist/schemas/email.d.ts.map +0 -1
- package/dist/schemas/email.js +0 -22
- package/dist/schemas/imessage.d.ts +0 -45
- package/dist/schemas/imessage.d.ts.map +0 -1
- package/dist/schemas/imessage.js +0 -37
- package/dist/schemas/index.d.ts +0 -10
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -9
- package/dist/schemas/leases.d.ts +0 -9
- package/dist/schemas/leases.d.ts.map +0 -1
- package/dist/schemas/leases.js +0 -6
- package/dist/schemas/otp.d.ts +0 -25
- package/dist/schemas/otp.d.ts.map +0 -1
- package/dist/schemas/otp.js +0 -13
- package/dist/schemas/product.d.ts +0 -12
- package/dist/schemas/product.d.ts.map +0 -1
- package/dist/schemas/product.js +0 -9
- package/dist/schemas/text.d.ts +0 -25
- package/dist/schemas/text.d.ts.map +0 -1
- package/dist/schemas/text.js +0 -19
- package/dist/schemas/voice.d.ts +0 -5
- package/dist/schemas/voice.d.ts.map +0 -1
- package/dist/schemas/voice.js +0 -2
- package/dist/schemas/whatsapp.d.ts +0 -32
- package/dist/schemas/whatsapp.d.ts.map +0 -1
- package/dist/schemas/whatsapp.js +0 -30
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/responses.d.ts +0 -8
- package/dist/types/responses.d.ts.map +0 -1
- package/dist/types/responses.js +0 -1
- package/dist/types/webhooks.d.ts +0 -48
- package/dist/types/webhooks.d.ts.map +0 -1
- package/dist/types/webhooks.js +0 -1
- package/dist/utils/errors.d.ts +0 -10
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -13
- package/dist/utils/normalize.d.ts +0 -13
- package/dist/utils/normalize.d.ts.map +0 -1
- package/dist/utils/normalize.js +0 -25
- package/dist/utils/response.d.ts +0 -12
- package/dist/utils/response.d.ts.map +0 -1
- package/dist/utils/response.js +0 -9
- package/dist/webhook/parse.d.ts +0 -6
- package/dist/webhook/parse.d.ts.map +0 -1
- package/dist/webhook/parse.js +0 -11
- package/dist/webhook/verify.d.ts +0 -6
- package/dist/webhook/verify.d.ts.map +0 -1
- package/dist/webhook/verify.js +0 -36
- /package/dist/{esm/types/responses.js → types/metadata.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../../src/schemas/voice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;iBAAoD,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const whatsappSendSchema: z.ZodObject<{
|
|
3
|
-
to: z.ZodString;
|
|
4
|
-
message: z.ZodString;
|
|
5
|
-
from: z.ZodOptional<z.ZodString>;
|
|
6
|
-
fallback: z.ZodOptional<z.ZodObject<{
|
|
7
|
-
when: z.ZodArray<z.ZodEnum<{
|
|
8
|
-
whatsapp_unsupported: "whatsapp_unsupported";
|
|
9
|
-
whatsapp_fails: "whatsapp_fails";
|
|
10
|
-
}>>;
|
|
11
|
-
from: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$strip>>;
|
|
13
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
-
}, z.core.$loose>;
|
|
15
|
-
export declare const whatsappTypingSchema: z.ZodObject<{
|
|
16
|
-
to: z.ZodString;
|
|
17
|
-
action: z.ZodEnum<{
|
|
18
|
-
start: "start";
|
|
19
|
-
stop: "stop";
|
|
20
|
-
}>;
|
|
21
|
-
from: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$loose>;
|
|
23
|
-
export type WhatsappSendParams = z.infer<typeof whatsappSendSchema>;
|
|
24
|
-
export type WhatsappTypingParams = z.infer<typeof whatsappTypingSchema>;
|
|
25
|
-
//# sourceMappingURL=whatsapp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../../src/schemas/whatsapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAaf,CAAC;AAEjB,eAAO,MAAM,oBAAoB;;;;;;;iBAMjB,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.whatsappTypingSchema = exports.whatsappSendSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.whatsappSendSchema = zod_1.z
|
|
6
|
-
.object({
|
|
7
|
-
to: zod_1.z.string(),
|
|
8
|
-
message: zod_1.z.string(),
|
|
9
|
-
from: zod_1.z.string().optional(),
|
|
10
|
-
fallback: zod_1.z
|
|
11
|
-
.object({
|
|
12
|
-
when: zod_1.z.array(zod_1.z.enum(["whatsapp_unsupported", "whatsapp_fails"])),
|
|
13
|
-
from: zod_1.z.string().optional(),
|
|
14
|
-
})
|
|
15
|
-
.optional(),
|
|
16
|
-
attachments: zod_1.z.array(zod_1.z.string()).optional(),
|
|
17
|
-
})
|
|
18
|
-
.passthrough();
|
|
19
|
-
exports.whatsappTypingSchema = zod_1.z
|
|
20
|
-
.object({
|
|
21
|
-
to: zod_1.z.string(),
|
|
22
|
-
action: zod_1.z.enum(["start", "stop"]),
|
|
23
|
-
from: zod_1.z.string().optional(),
|
|
24
|
-
})
|
|
25
|
-
.passthrough();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
package/dist/cjs/types/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./responses.js"), exports);
|
|
18
|
-
__exportStar(require("./webhooks.js"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/types/responses.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Webhook event types (v2 format) */
|
|
2
|
-
export type WebhookEventType = "text.incoming.sms" | "text.incoming.mms" | "text.delivery.confirmed" | "text.delivery.failed" | "imessage.incoming" | "numbers.substitution" | "otp.reverse.verified" | "email.incoming" | "identity.verification_session.started" | "identity.verification_session.processing" | "identity.verification_session.verified" | "identity.verification_session.failed" | "identity.verification_session.requires_input" | "identity.verification_session.manually_approved" | "identity.verification_session.manually_denied" | "identity.verification_report.generated";
|
|
3
|
-
export interface WebhookEventBase {
|
|
4
|
-
id: string;
|
|
5
|
-
type: WebhookEventType;
|
|
6
|
-
timestamp: number;
|
|
7
|
-
api_version: string;
|
|
8
|
-
data: Record<string, unknown>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/types/webhooks.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,sBAAsB,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,uCAAuC,GACvC,0CAA0C,GAC1C,wCAAwC,GACxC,sCAAsC,GACtC,8CAA8C,GAC9C,iDAAiD,GACjD,+CAA+C,GAC/C,wCAAwC,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,MAAM,CAAC,EAAE,MAAM;aACf,IAAI,CAAC,EAAE,MAAM;gBAF7B,OAAO,EAAE,MAAM,EACC,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,IAAI,CAAC,EAAE,MAAM,YAAA;CAMhC"}
|
package/dist/cjs/utils/errors.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContiguityError = void 0;
|
|
4
|
-
class ContiguityError extends Error {
|
|
5
|
-
status;
|
|
6
|
-
code;
|
|
7
|
-
constructor(message, status, code) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.status = status;
|
|
10
|
-
this.code = code;
|
|
11
|
-
this.name = "ContiguityError";
|
|
12
|
-
Object.setPrototypeOf(this, ContiguityError.prototype);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ContiguityError = ContiguityError;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const BASE_URLS: {
|
|
2
|
-
readonly send: "https://api.contiguity.com/send";
|
|
3
|
-
readonly otp: "https://api.contiguity.com/otp";
|
|
4
|
-
readonly domains: "https://api.contiguity.com/domains";
|
|
5
|
-
readonly numbers: "https://api.contiguity.com/numbers";
|
|
6
|
-
readonly conversations: "https://api.contiguity.com/conversations";
|
|
7
|
-
readonly voice: "https://api.contiguity.com/voice";
|
|
8
|
-
};
|
|
9
|
-
export type ApiBase = keyof typeof BASE_URLS;
|
|
10
|
-
export interface RequestConfig {
|
|
11
|
-
token: string;
|
|
12
|
-
base: ApiBase;
|
|
13
|
-
debug?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function request<T = Record<string, unknown>>(config: RequestConfig, path: string, options?: {
|
|
16
|
-
method?: "GET" | "POST" | "DELETE";
|
|
17
|
-
body?: Record<string, unknown>;
|
|
18
|
-
}): Promise<T & {
|
|
19
|
-
metadata: {
|
|
20
|
-
id: string;
|
|
21
|
-
timestamp: string;
|
|
22
|
-
api_version: string;
|
|
23
|
-
object: string;
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/utils/request.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS;;;;;;;CAOL,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvD,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3B,GACL,OAAO,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAwBnG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.request = request;
|
|
4
|
-
const response_js_1 = require("./response.js");
|
|
5
|
-
const errors_js_1 = require("./errors.js");
|
|
6
|
-
const BASE_URLS = {
|
|
7
|
-
send: "https://api.contiguity.com/send",
|
|
8
|
-
otp: "https://api.contiguity.com/otp",
|
|
9
|
-
domains: "https://api.contiguity.com/domains",
|
|
10
|
-
numbers: "https://api.contiguity.com/numbers",
|
|
11
|
-
conversations: "https://api.contiguity.com/conversations",
|
|
12
|
-
voice: "https://api.contiguity.com/voice",
|
|
13
|
-
};
|
|
14
|
-
async function request(config, path, options = {}) {
|
|
15
|
-
const { token, base, debug } = config;
|
|
16
|
-
const url = `${BASE_URLS[base]}${path}`;
|
|
17
|
-
const headers = {
|
|
18
|
-
"Content-Type": "application/json",
|
|
19
|
-
Authorization: `Token ${token}`,
|
|
20
|
-
};
|
|
21
|
-
if (debug) {
|
|
22
|
-
console.debug("[contiguity]", options.method ?? "GET", url, options.body ?? "");
|
|
23
|
-
}
|
|
24
|
-
const res = await fetch(url, {
|
|
25
|
-
method: options.method ?? "GET",
|
|
26
|
-
headers,
|
|
27
|
-
body: options.body ? JSON.stringify(options.body) : undefined,
|
|
28
|
-
});
|
|
29
|
-
const json = (await res.json());
|
|
30
|
-
if (!res.ok) {
|
|
31
|
-
const errMsg = json.data?.error ?? json.object ?? "Unknown error";
|
|
32
|
-
const status = json.data?.status ?? res.status;
|
|
33
|
-
throw new errors_js_1.ContiguityError(errMsg, status);
|
|
34
|
-
}
|
|
35
|
-
return (0, response_js_1.transformResponse)(json);
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ResponseMetadata } from "../types/responses.js";
|
|
2
|
-
export interface RawApiResponse {
|
|
3
|
-
id: string;
|
|
4
|
-
timestamp: number;
|
|
5
|
-
api_version: string;
|
|
6
|
-
object: string;
|
|
7
|
-
data: Record<string, unknown>;
|
|
8
|
-
}
|
|
9
|
-
export declare function transformResponse(res: RawApiResponse): Record<string, unknown> & {
|
|
10
|
-
metadata: ResponseMetadata;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/utils/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAQ/G"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformResponse = transformResponse;
|
|
4
|
-
function transformResponse(res) {
|
|
5
|
-
const metadata = {
|
|
6
|
-
id: res.id,
|
|
7
|
-
timestamp: String(res.timestamp),
|
|
8
|
-
api_version: res.api_version,
|
|
9
|
-
object: res.object,
|
|
10
|
-
};
|
|
11
|
-
return { ...res.data, metadata };
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/webhook/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,sBAAsB,CAAC;AAE/E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAO/E"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseWebhookPayload = parseWebhookPayload;
|
|
4
|
-
/**
|
|
5
|
-
* Parse raw webhook body (v2 format) into a typed event.
|
|
6
|
-
*/
|
|
7
|
-
function parseWebhookPayload(raw_body) {
|
|
8
|
-
const str = typeof raw_body === "string" ? raw_body : raw_body.toString("utf-8");
|
|
9
|
-
const event = JSON.parse(str);
|
|
10
|
-
if (typeof event.id !== "string" || typeof event.type !== "string" || typeof event.timestamp !== "number") {
|
|
11
|
-
throw new Error("Invalid webhook payload: missing id, type, or timestamp");
|
|
12
|
-
}
|
|
13
|
-
return event;
|
|
14
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verify webhook signature (HMAC-SHA256, format t=timestamp,v1=hex).
|
|
3
|
-
* Use raw body as received — do not re-serialize JSON.
|
|
4
|
-
*/
|
|
5
|
-
export declare function verifyWebhookSignature(raw_body: string | Buffer, signature_header: string | null | undefined, secret: string | null | undefined, tolerance_seconds?: number): boolean;
|
|
6
|
-
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/webhook/verify.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3C,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,iBAAiB,CAAC,EAAE,MAAM,GAC3B,OAAO,CAsBT"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyWebhookSignature = verifyWebhookSignature;
|
|
4
|
-
const node_crypto_1 = require("node:crypto");
|
|
5
|
-
/**
|
|
6
|
-
* Verify webhook signature (HMAC-SHA256, format t=timestamp,v1=hex).
|
|
7
|
-
* Use raw body as received — do not re-serialize JSON.
|
|
8
|
-
*/
|
|
9
|
-
function verifyWebhookSignature(raw_body, signature_header, secret, tolerance_seconds) {
|
|
10
|
-
if (!secret || !signature_header || raw_body == null)
|
|
11
|
-
return false;
|
|
12
|
-
const match = signature_header.match(/t=(\d+),v1=([a-f0-9]+)/);
|
|
13
|
-
if (!match)
|
|
14
|
-
return false;
|
|
15
|
-
const [, t, v1] = match;
|
|
16
|
-
if (!t || !v1)
|
|
17
|
-
return false;
|
|
18
|
-
const body_str = typeof raw_body === "string" ? raw_body : raw_body.toString("utf-8");
|
|
19
|
-
const signed_payload = `${t}.${body_str}`;
|
|
20
|
-
const expected = (0, node_crypto_1.createHmac)("sha256", secret).update(signed_payload).digest("hex");
|
|
21
|
-
if (v1.length !== expected.length)
|
|
22
|
-
return false;
|
|
23
|
-
try {
|
|
24
|
-
if (!(0, node_crypto_1.timingSafeEqual)(Buffer.from(v1, "hex"), Buffer.from(expected, "hex")))
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
if (tolerance_seconds != null) {
|
|
31
|
-
const ts = parseInt(t, 10);
|
|
32
|
-
if (Number.isNaN(ts))
|
|
33
|
-
return false;
|
|
34
|
-
const now = Math.floor(Date.now() / 1000);
|
|
35
|
-
if (Math.abs(now - ts) > tolerance_seconds)
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
package/dist/client.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { TextResource } from "./resources/text.js";
|
|
2
|
-
import { EmailResource } from "./resources/email.js";
|
|
3
|
-
import { OtpResource } from "./resources/otp.js";
|
|
4
|
-
import { DomainsResource } from "./resources/domains.js";
|
|
5
|
-
import { LeaseResource } from "./resources/lease.js";
|
|
6
|
-
import { EntitlementsResource } from "./resources/entitlements.js";
|
|
7
|
-
import { AgreementsResource } from "./resources/agreements.js";
|
|
8
|
-
import { ImessageResource } from "./resources/imessage.js";
|
|
9
|
-
import { WhatsappResource } from "./resources/whatsapp.js";
|
|
10
|
-
import { WebhookResource } from "./resources/webhook.js";
|
|
11
|
-
export interface ContiguityConfig {
|
|
12
|
-
debug?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class Contiguity {
|
|
15
|
-
readonly text: TextResource;
|
|
16
|
-
readonly email: EmailResource;
|
|
17
|
-
readonly otp: OtpResource;
|
|
18
|
-
readonly domains: DomainsResource;
|
|
19
|
-
readonly lease: LeaseResource;
|
|
20
|
-
readonly entitlements: EntitlementsResource;
|
|
21
|
-
readonly agreements: AgreementsResource;
|
|
22
|
-
readonly imessage: ImessageResource;
|
|
23
|
-
readonly whatsapp: WhatsappResource;
|
|
24
|
-
readonly webhook: WebhookResource;
|
|
25
|
-
constructor(token?: string, config?: ContiguityConfig);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,UAAU;IACnB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAEpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEtB,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB;CA4B5D"}
|
package/dist/client.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { TextResource } from "./resources/text.js";
|
|
2
|
-
import { EmailResource } from "./resources/email.js";
|
|
3
|
-
import { OtpResource } from "./resources/otp.js";
|
|
4
|
-
import { DomainsResource } from "./resources/domains.js";
|
|
5
|
-
import { LeaseResource } from "./resources/lease.js";
|
|
6
|
-
import { EntitlementsResource } from "./resources/entitlements.js";
|
|
7
|
-
import { AgreementsResource } from "./resources/agreements.js";
|
|
8
|
-
import { ImessageResource } from "./resources/imessage.js";
|
|
9
|
-
import { WhatsappResource } from "./resources/whatsapp.js";
|
|
10
|
-
// import { VoiceResource } from "./resources/voice.js";
|
|
11
|
-
import { WebhookResource } from "./resources/webhook.js";
|
|
12
|
-
export class Contiguity {
|
|
13
|
-
text;
|
|
14
|
-
email;
|
|
15
|
-
otp;
|
|
16
|
-
domains;
|
|
17
|
-
lease;
|
|
18
|
-
entitlements;
|
|
19
|
-
agreements;
|
|
20
|
-
imessage;
|
|
21
|
-
whatsapp;
|
|
22
|
-
// readonly voice: VoiceResource;
|
|
23
|
-
webhook;
|
|
24
|
-
constructor(token, config = {}) {
|
|
25
|
-
const env = typeof process !== "undefined" ? process.env : undefined;
|
|
26
|
-
const resolved = token ?? env?.CONTIGUITY_API_KEY ?? env?.CONTIGUITY_TOKEN;
|
|
27
|
-
if (!resolved) {
|
|
28
|
-
throw new Error("Contiguity token required. Pass it to the constructor or set an environment variable (CONTIGUITY_API_KEY or CONTIGUITY_TOKEN)");
|
|
29
|
-
}
|
|
30
|
-
if (!resolved.includes("contiguity_sk_")) {
|
|
31
|
-
throw new Error("Invalid Contiguity token: key must start with contiguity_sk_.");
|
|
32
|
-
}
|
|
33
|
-
const request_config = {
|
|
34
|
-
token: resolved,
|
|
35
|
-
base: "send",
|
|
36
|
-
debug: config.debug ?? false,
|
|
37
|
-
};
|
|
38
|
-
this.text = new TextResource(request_config);
|
|
39
|
-
this.email = new EmailResource(request_config);
|
|
40
|
-
this.otp = new OtpResource({ ...request_config, base: "otp" });
|
|
41
|
-
this.domains = new DomainsResource({ ...request_config, base: "domains" });
|
|
42
|
-
this.lease = new LeaseResource({ ...request_config, base: "numbers" });
|
|
43
|
-
this.entitlements = new EntitlementsResource({ ...request_config, base: "entitlements" });
|
|
44
|
-
this.agreements = new AgreementsResource(this.entitlements);
|
|
45
|
-
this.imessage = new ImessageResource(request_config);
|
|
46
|
-
this.whatsapp = new WhatsappResource(request_config);
|
|
47
|
-
// this.voice = new VoiceResource({ ...request_config, base: "voice" });
|
|
48
|
-
this.webhook = new WebhookResource();
|
|
49
|
-
}
|
|
50
|
-
}
|
package/dist/esm/client.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { TextResource } from "./resources/text.js";
|
|
2
|
-
import { EmailResource } from "./resources/email.js";
|
|
3
|
-
import { OtpResource } from "./resources/otp.js";
|
|
4
|
-
import { DomainsResource } from "./resources/domains.js";
|
|
5
|
-
import { LeaseResource } from "./resources/lease.js";
|
|
6
|
-
import { ImessageResource } from "./resources/imessage.js";
|
|
7
|
-
import { WhatsappResource } from "./resources/whatsapp.js";
|
|
8
|
-
import { ConversationsResource } from "./resources/conversations.js";
|
|
9
|
-
import { VoiceResource } from "./resources/voice.js";
|
|
10
|
-
import { WebhookResource } from "./resources/webhook.js";
|
|
11
|
-
export interface ContiguityConfig {
|
|
12
|
-
debug?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class Contiguity {
|
|
15
|
-
readonly text: TextResource;
|
|
16
|
-
readonly email: EmailResource;
|
|
17
|
-
readonly otp: OtpResource;
|
|
18
|
-
readonly domains: DomainsResource;
|
|
19
|
-
readonly lease: LeaseResource;
|
|
20
|
-
readonly imessage: ImessageResource;
|
|
21
|
-
readonly whatsapp: WhatsappResource;
|
|
22
|
-
readonly conversations: ConversationsResource;
|
|
23
|
-
readonly voice: VoiceResource;
|
|
24
|
-
readonly webhook: WebhookResource;
|
|
25
|
-
constructor(token: string, config?: ContiguityConfig);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/esm/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEtB,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB;CAiBzD"}
|
package/dist/esm/client.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TextResource } from "./resources/text.js";
|
|
2
|
-
import { EmailResource } from "./resources/email.js";
|
|
3
|
-
import { OtpResource } from "./resources/otp.js";
|
|
4
|
-
import { DomainsResource } from "./resources/domains.js";
|
|
5
|
-
import { LeaseResource } from "./resources/lease.js";
|
|
6
|
-
import { ImessageResource } from "./resources/imessage.js";
|
|
7
|
-
import { WhatsappResource } from "./resources/whatsapp.js";
|
|
8
|
-
import { ConversationsResource } from "./resources/conversations.js";
|
|
9
|
-
import { VoiceResource } from "./resources/voice.js";
|
|
10
|
-
import { WebhookResource } from "./resources/webhook.js";
|
|
11
|
-
export class Contiguity {
|
|
12
|
-
text;
|
|
13
|
-
email;
|
|
14
|
-
otp;
|
|
15
|
-
domains;
|
|
16
|
-
lease;
|
|
17
|
-
imessage;
|
|
18
|
-
whatsapp;
|
|
19
|
-
conversations;
|
|
20
|
-
voice;
|
|
21
|
-
webhook;
|
|
22
|
-
constructor(token, config = {}) {
|
|
23
|
-
const request_config = {
|
|
24
|
-
token,
|
|
25
|
-
base: "send",
|
|
26
|
-
debug: config.debug ?? false,
|
|
27
|
-
};
|
|
28
|
-
this.text = new TextResource(request_config);
|
|
29
|
-
this.email = new EmailResource(request_config);
|
|
30
|
-
this.otp = new OtpResource({ ...request_config, base: "otp" });
|
|
31
|
-
this.domains = new DomainsResource({ ...request_config, base: "domains" });
|
|
32
|
-
this.lease = new LeaseResource({ ...request_config, base: "numbers" });
|
|
33
|
-
this.imessage = new ImessageResource(request_config);
|
|
34
|
-
this.whatsapp = new WhatsappResource(request_config);
|
|
35
|
-
this.conversations = new ConversationsResource({ ...request_config, base: "conversations" });
|
|
36
|
-
this.voice = new VoiceResource({ ...request_config, base: "voice" });
|
|
37
|
-
this.webhook = new WebhookResource();
|
|
38
|
-
}
|
|
39
|
-
}
|
package/dist/esm/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { Contiguity } from "./client.js";
|
|
2
|
-
export type { ContiguityConfig } from "./client.js";
|
|
3
|
-
export { ContiguityError } from "./utils/errors.js";
|
|
4
|
-
export { verifyWebhookSignature } from "./webhook/verify.js";
|
|
5
|
-
export { parseWebhookPayload } from "./webhook/parse.js";
|
|
6
|
-
export type { ResponseMetadata } from "./types/responses.js";
|
|
7
|
-
export type { WebhookEventBase, WebhookEventType } from "./types/webhooks.js";
|
|
8
|
-
export type { TextSendParams } from "./schemas/text.js";
|
|
9
|
-
export type { EmailSendParams } from "./schemas/email.js";
|
|
10
|
-
export type { OtpNewParams, OtpVerifyParams, OtpResendParams, OtpReverseInitiateParams } from "./schemas/otp.js";
|
|
11
|
-
export type { ImessageSendParams, ImessageTypingParams } from "./schemas/imessage.js";
|
|
12
|
-
export type { WhatsappSendParams, WhatsappTypingParams } from "./schemas/whatsapp.js";
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjH,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/esm/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { RequestConfig } from "../utils/request.js";
|
|
2
|
-
export declare class ConversationsResource {
|
|
3
|
-
private readonly config;
|
|
4
|
-
constructor(config: RequestConfig);
|
|
5
|
-
getMessage(id: string): Promise<Record<string, unknown> & {
|
|
6
|
-
metadata: {
|
|
7
|
-
id: string;
|
|
8
|
-
timestamp: string;
|
|
9
|
-
api_version: string;
|
|
10
|
-
object: string;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
textHistory(to: string, from: string, limit?: number): Promise<Record<string, unknown> & {
|
|
14
|
-
metadata: {
|
|
15
|
-
id: string;
|
|
16
|
-
timestamp: string;
|
|
17
|
-
api_version: string;
|
|
18
|
-
object: string;
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
imessageHistory(to: string, from: string, limit?: number): Promise<Record<string, unknown> & {
|
|
22
|
-
metadata: {
|
|
23
|
-
id: string;
|
|
24
|
-
timestamp: string;
|
|
25
|
-
api_version: string;
|
|
26
|
-
object: string;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/resources/conversations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,UAAU,CAAC,EAAE,EAAE,MAAM;;;;;;;;IAIrB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;;;;;;;;IAMxD,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;;;;;;;;CAKnE"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { request } from "../utils/request.js";
|
|
2
|
-
export class ConversationsResource {
|
|
3
|
-
config;
|
|
4
|
-
constructor(config) {
|
|
5
|
-
this.config = config;
|
|
6
|
-
}
|
|
7
|
-
async getMessage(id) {
|
|
8
|
-
return request(this.config, `/history/message/${encodeURIComponent(id)}`, { method: "GET" });
|
|
9
|
-
}
|
|
10
|
-
async textHistory(to, from, limit = 20) {
|
|
11
|
-
return request(this.config, `/history/text/${encodeURIComponent(to)}/${encodeURIComponent(from)}/${limit}`, {
|
|
12
|
-
method: "GET",
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
async imessageHistory(to, from, limit = 20) {
|
|
16
|
-
return request(this.config, `/history/imessage/${encodeURIComponent(to)}/${encodeURIComponent(from)}/${limit}`, {
|
|
17
|
-
method: "GET",
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type DomainsRegisterOptions } from "../schemas/domains.js";
|
|
2
|
-
import type { RequestConfig } from "../utils/request.js";
|
|
3
|
-
export declare class DomainsResource {
|
|
4
|
-
private readonly config;
|
|
5
|
-
constructor(config: RequestConfig);
|
|
6
|
-
list(): Promise<Record<string, unknown> & {
|
|
7
|
-
metadata: {
|
|
8
|
-
id: string;
|
|
9
|
-
timestamp: string;
|
|
10
|
-
api_version: string;
|
|
11
|
-
object: string;
|
|
12
|
-
};
|
|
13
|
-
}>;
|
|
14
|
-
get(domain: string): Promise<Record<string, unknown> & {
|
|
15
|
-
metadata: {
|
|
16
|
-
id: string;
|
|
17
|
-
timestamp: string;
|
|
18
|
-
api_version: string;
|
|
19
|
-
object: string;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
register(domain: string, options?: DomainsRegisterOptions): Promise<Record<string, unknown> & {
|
|
23
|
-
metadata: {
|
|
24
|
-
id: string;
|
|
25
|
-
timestamp: string;
|
|
26
|
-
api_version: string;
|
|
27
|
-
object: string;
|
|
28
|
-
};
|
|
29
|
-
}>;
|
|
30
|
-
delete(domain: string): Promise<Record<string, unknown> & {
|
|
31
|
-
metadata: {
|
|
32
|
-
id: string;
|
|
33
|
-
timestamp: string;
|
|
34
|
-
api_version: string;
|
|
35
|
-
object: string;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=domains.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/resources/domains.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,IAAI;;;;;;;;IAIJ,GAAG,CAAC,MAAM,EAAE,MAAM;;;;;;;;IAIlB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB;;;;;;;;IAQzD,MAAM,CAAC,MAAM,EAAE,MAAM;;;;;;;;CAG5B"}
|