contiguity 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/resources/imessage.d.ts +2 -2
- package/dist/resources/imessage.d.ts.map +1 -1
- package/dist/resources/imessage.js +7 -4
- package/dist/resources/otp.d.ts +4 -4
- package/dist/resources/otp.d.ts.map +1 -1
- package/dist/resources/text.d.ts +2 -2
- package/dist/resources/text.d.ts.map +1 -1
- package/dist/resources/text.js +7 -4
- package/dist/schemas/conversations.d.ts +6 -1
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js +7 -0
- package/dist/schemas/otp.d.ts +31 -0
- package/dist/schemas/otp.d.ts.map +1 -1
- package/dist/schemas/otp.js +2 -0
- package/dist/types/webhooks.d.ts +6 -0
- package/dist/types/webhooks.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,6 @@ For complete documentation, examples, and API reference, visit [docs.contiguity.
|
|
|
73
73
|
## Resources
|
|
74
74
|
|
|
75
75
|
- [API Reference](https://docs.contiguity.com/api-reference/) - Complete API documentation
|
|
76
|
-
- [Console](https://console.contiguity.com/) - Manage your account and API keys
|
|
76
|
+
- [Console](https://console.contiguity.com/) - Manage your account and API keys, see usage, apply for entitlements, and more
|
|
77
77
|
- [Discord Community](https://discord.gg/Z9K5XAsS7H) - Get support and connect with other developers
|
|
78
78
|
- [GitHub Repository](https://github.com/contiguity/javascript) - Source code and issue tracking
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ export type { ContiguityErrorData } from "./utils/errors.js";
|
|
|
5
5
|
export { verifyWebhookSignature } from "./webhook/verify.js";
|
|
6
6
|
export { parseWebhookPayload } from "./webhook/parse.js";
|
|
7
7
|
export type { ResponseMetadata } from "./types/responses.js";
|
|
8
|
-
export type { WebhookEventBase, WebhookEventType, IncomingMessageData, TextIncomingData, ImessageIncomingData, TextDeliveryData, } from "./types/webhooks.js";
|
|
8
|
+
export type { WebhookEventBase, WebhookEventType, IncomingMessageData, TextIncomingData, ImessageIncomingData, TextDeliveryData, OtpReverseVerifiedData, } from "./types/webhooks.js";
|
|
9
9
|
export type { TextSendParams, TextReactParams } from "./schemas/text.js";
|
|
10
10
|
export type { EmailSendParams } from "./schemas/email.js";
|
|
11
11
|
export { renderReactEmail } from "./utils/react-email.js";
|
|
12
|
-
export type { OtpSendParams, OtpNewParams, OtpVerifyParams, OtpResendParams, OtpReverseInitiateParams, } from "./schemas/otp.js";
|
|
12
|
+
export type { OtpSendParams, OtpNewParams, OtpVerifyParams, OtpResendParams, OtpReverseService, OtpReverseInitiateParams, OtpReverseInitiateResponse, OtpReverseVerifyResponse, OtpReverseCancelResponse, } from "./schemas/otp.js";
|
|
13
13
|
export type { AvailableLeaseNumber, LeaseAvailableResponse, LeaseCreateOptions, } from "./schemas/leases.js";
|
|
14
14
|
export type { ImessageSendParams, ImessageTypingParams, ImessageReactParams, ImessageReadParams, } from "./schemas/imessage.js";
|
|
15
15
|
export type { WhatsappSendParams, WhatsappTypingParams, WhatsappReactParams } from "./schemas/whatsapp.js";
|
|
16
|
-
export type { ConversationHistoryParams } from "./schemas/conversations.js";
|
|
16
|
+
export type { ConversationGetParams, ConversationHistoryParams, } from "./schemas/conversations.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,O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C;AAC7B,YAAY,EACR,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,YAAY,EACV,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ImessageSendParams, type ImessageTypingParams, type ImessageReactParams, type ImessageReadParams } from "../schemas/imessage.js";
|
|
2
|
-
import { type ConversationHistoryParams } from "../schemas/conversations.js";
|
|
2
|
+
import { type ConversationGetParams, type ConversationHistoryParams } from "../schemas/conversations.js";
|
|
3
3
|
import type { RequestConfig } from "../utils/request.js";
|
|
4
4
|
import type { WebhookEventBase } from "../types/webhooks.js";
|
|
5
5
|
export declare class ImessageResource {
|
|
@@ -34,7 +34,7 @@ export declare class ImessageResource {
|
|
|
34
34
|
object: string;
|
|
35
35
|
};
|
|
36
36
|
}>;
|
|
37
|
-
get(id: string): Promise<Record<string, unknown> & {
|
|
37
|
+
get(id: string, params?: ConversationGetParams): Promise<Record<string, unknown> & {
|
|
38
38
|
metadata: {
|
|
39
39
|
id: string;
|
|
40
40
|
timestamp: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imessage.d.ts","sourceRoot":"","sources":["../../src/resources/imessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAKH,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"imessage.d.ts","sourceRoot":"","sources":["../../src/resources/imessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAKH,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGH,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAa,gBAAgB;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,+EAA+E;IACzE,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC;oBAUnD,MAAM;;;;;;;;;IAFjC,IAAI,CAAC,MAAM,EAAE,kBAAkB;oBAEJ,MAAM;;;;;;;;;IAMjC,MAAM,CAAC,MAAM,EAAE,oBAAoB;;;;;;;;IAQnC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,qBAA0B;;;;;;;;IAUlD,OAAO,CAAC,MAAM,EAAE,yBAAyB;;;;;;;;IAWzC,KAAK,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,mBAAmB;;;;;;;;IAS3D,IAAI,CAAC,MAAM,EAAE,kBAAkB;;;;;;;;CAOxC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { request } from "../utils/request.js";
|
|
3
3
|
import { imessageSendSchema, imessageTypingSchema, imessageReactSchema, imessageReadSchema, } from "../schemas/imessage.js";
|
|
4
|
-
import { conversationHistorySchema, } from "../schemas/conversations.js";
|
|
4
|
+
import { conversationGetSchema, conversationHistorySchema, } from "../schemas/conversations.js";
|
|
5
5
|
export class ImessageResource {
|
|
6
6
|
config;
|
|
7
7
|
constructor(config) {
|
|
@@ -29,13 +29,16 @@ export class ImessageResource {
|
|
|
29
29
|
body: parsed,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
async get(id) {
|
|
33
|
-
|
|
32
|
+
async get(id, params = {}) {
|
|
33
|
+
const parsed = conversationGetSchema.parse(params);
|
|
34
|
+
const tracking = parsed.tracking ? "?tracking=true" : "";
|
|
35
|
+
return request({ ...this.config, base: "conversations" }, `/history/message/${encodeURIComponent(id)}${tracking}`, { method: "GET" });
|
|
34
36
|
}
|
|
35
37
|
async history(params) {
|
|
36
38
|
const parsed = conversationHistorySchema.parse(params);
|
|
37
39
|
const limit = parsed.limit ?? 20;
|
|
38
|
-
|
|
40
|
+
const tracking = parsed.tracking ? "?tracking=true" : "";
|
|
41
|
+
return request({ ...this.config, base: "conversations" }, `/history/imessage/${encodeURIComponent(parsed.to)}/${encodeURIComponent(parsed.from)}/${limit}${tracking}`, { method: "GET" });
|
|
39
42
|
}
|
|
40
43
|
async react(action, params) {
|
|
41
44
|
const _action = z.enum(["add", "remove"]).parse(action);
|
package/dist/resources/otp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RequestConfig } from "../utils/request.js";
|
|
2
|
-
import { type OtpSendParams, type OtpVerifyParams, type OtpResendParams, type OtpReverseInitiateParams } from "../schemas/otp.js";
|
|
2
|
+
import { type OtpSendParams, type OtpVerifyParams, type OtpResendParams, type OtpReverseInitiateParams, type OtpReverseInitiateResponse, type OtpReverseVerifyResponse, type OtpReverseCancelResponse } from "../schemas/otp.js";
|
|
3
3
|
export declare class OtpResource {
|
|
4
4
|
private readonly config;
|
|
5
5
|
constructor(config: RequestConfig);
|
|
@@ -45,7 +45,7 @@ export declare class OtpResource {
|
|
|
45
45
|
};
|
|
46
46
|
}>;
|
|
47
47
|
readonly reverse: {
|
|
48
|
-
initiate: (params: OtpReverseInitiateParams) => Promise<
|
|
48
|
+
initiate: (params: OtpReverseInitiateParams) => Promise<OtpReverseInitiateResponse & {
|
|
49
49
|
metadata: {
|
|
50
50
|
id: string;
|
|
51
51
|
timestamp: string;
|
|
@@ -53,7 +53,7 @@ export declare class OtpResource {
|
|
|
53
53
|
object: string;
|
|
54
54
|
};
|
|
55
55
|
}>;
|
|
56
|
-
verify: (otp_id: string) => Promise<
|
|
56
|
+
verify: (otp_id: string) => Promise<OtpReverseVerifyResponse & {
|
|
57
57
|
metadata: {
|
|
58
58
|
id: string;
|
|
59
59
|
timestamp: string;
|
|
@@ -61,7 +61,7 @@ export declare class OtpResource {
|
|
|
61
61
|
object: string;
|
|
62
62
|
};
|
|
63
63
|
}>;
|
|
64
|
-
cancel: (otp_id: string) => Promise<
|
|
64
|
+
cancel: (otp_id: string) => Promise<OtpReverseCancelResponse & {
|
|
65
65
|
metadata: {
|
|
66
66
|
id: string;
|
|
67
67
|
timestamp: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../src/resources/otp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,IAAI,CAAC,MAAM,EAAE,aAAa;gBAEL,MAAM;;;;;;;;;IAMjC,sCAAsC;IAChC,GAAG,CAAC,MAAM,EAAE,aAAa;gBAPJ,MAAM;;;;;;;;;IAW3B,MAAM,CAAC,MAAM,EAAE,eAAe;kBAEP,OAAO;;;;;;;;;IAM9B,MAAM,CAAC,MAAM,EAAE,eAAe;gBAET,OAAO;;;;;;;;;IAMlC,QAAQ,CAAC,OAAO;2BACK,wBAAwB;;;;;;;;yBAO1B,MAAM;;;;;;;;
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../src/resources/otp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,IAAI,CAAC,MAAM,EAAE,aAAa;gBAEL,MAAM;;;;;;;;;IAMjC,sCAAsC;IAChC,GAAG,CAAC,MAAM,EAAE,aAAa;gBAPJ,MAAM;;;;;;;;;IAW3B,MAAM,CAAC,MAAM,EAAE,eAAe;kBAEP,OAAO;;;;;;;;;IAM9B,MAAM,CAAC,MAAM,EAAE,eAAe;gBAET,OAAO;;;;;;;;;IAMlC,QAAQ,CAAC,OAAO;2BACK,wBAAwB;;;;;;;;yBAO1B,MAAM;;;;;;;;yBAON,MAAM;;;;;;;;MAOvB;CACH"}
|
package/dist/resources/text.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TextSendParams, type TextReactParams } from "../schemas/text.js";
|
|
2
|
-
import { type ConversationHistoryParams } from "../schemas/conversations.js";
|
|
2
|
+
import { type ConversationGetParams, type ConversationHistoryParams } from "../schemas/conversations.js";
|
|
3
3
|
import type { RequestConfig } from "../utils/request.js";
|
|
4
4
|
import type { WebhookEventBase } from "../types/webhooks.js";
|
|
5
5
|
export declare class TextResource {
|
|
@@ -26,7 +26,7 @@ export declare class TextResource {
|
|
|
26
26
|
object: string;
|
|
27
27
|
};
|
|
28
28
|
}>;
|
|
29
|
-
get(id: string): Promise<Record<string, unknown> & {
|
|
29
|
+
get(id: string, params?: ConversationGetParams): Promise<Record<string, unknown> & {
|
|
30
30
|
metadata: {
|
|
31
31
|
id: string;
|
|
32
32
|
timestamp: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/resources/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,cAAc,EACnB,KAAK,eAAe,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/resources/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,cAAc,EACnB,KAAK,eAAe,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAa,YAAY;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,2EAA2E;IACrE,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;oBAU/C,MAAM;;;;;;;;;IAFjC,IAAI,CAAC,MAAM,EAAE,cAAc;oBAEA,MAAM;;;;;;;;;IAMjC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,qBAA0B;;;;;;;;IAUlD,OAAO,CAAC,MAAM,EAAE,yBAAyB;;;;;;;;IAWzC,KAAK,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,eAAe;oBAG5B,MAAM;;;;;;;;;CAK1C"}
|
package/dist/resources/text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { request } from "../utils/request.js";
|
|
3
3
|
import { textSendSchema, textReactSchema, } from "../schemas/text.js";
|
|
4
|
-
import { conversationHistorySchema, } from "../schemas/conversations.js";
|
|
4
|
+
import { conversationGetSchema, conversationHistorySchema, } from "../schemas/conversations.js";
|
|
5
5
|
export class TextResource {
|
|
6
6
|
config;
|
|
7
7
|
constructor(config) {
|
|
@@ -22,13 +22,16 @@ export class TextResource {
|
|
|
22
22
|
body: parsed,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async get(id) {
|
|
26
|
-
|
|
25
|
+
async get(id, params = {}) {
|
|
26
|
+
const parsed = conversationGetSchema.parse(params);
|
|
27
|
+
const tracking = parsed.tracking ? "?tracking=true" : "";
|
|
28
|
+
return request({ ...this.config, base: "conversations" }, `/history/message/${encodeURIComponent(id)}${tracking}`, { method: "GET" });
|
|
27
29
|
}
|
|
28
30
|
async history(params) {
|
|
29
31
|
const parsed = conversationHistorySchema.parse(params);
|
|
30
32
|
const limit = parsed.limit ?? 20;
|
|
31
|
-
|
|
33
|
+
const tracking = parsed.tracking ? "?tracking=true" : "";
|
|
34
|
+
return request({ ...this.config, base: "conversations" }, `/history/text/${encodeURIComponent(parsed.to)}/${encodeURIComponent(parsed.from)}/${limit}${tracking}`, { method: "GET" });
|
|
32
35
|
}
|
|
33
36
|
async react(action, params) {
|
|
34
37
|
const _action = z.enum(["add", "remove"]).parse(action);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const conversationGetSchema: z.ZodObject<{
|
|
3
|
+
tracking: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
4
|
+
}, z.core.$loose>;
|
|
2
5
|
export declare const conversationHistorySchema: z.ZodObject<{
|
|
3
6
|
to: z.ZodString;
|
|
4
7
|
from: z.ZodString;
|
|
5
8
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
tracking: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
6
10
|
}, z.core.$loose>;
|
|
7
|
-
export type
|
|
11
|
+
export type ConversationGetParams = z.input<typeof conversationGetSchema>;
|
|
12
|
+
export type ConversationHistoryParams = z.input<typeof conversationHistorySchema>;
|
|
8
13
|
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/schemas/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/schemas/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;iBAItB,CAAC;AAEb,eAAO,MAAM,yBAAyB;;;;;iBAO1B,CAAC;AAEb,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
const trackingSchema = z.boolean().nullish().default(false);
|
|
3
|
+
export const conversationGetSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
tracking: trackingSchema,
|
|
6
|
+
})
|
|
7
|
+
.loose();
|
|
2
8
|
export const conversationHistorySchema = z
|
|
3
9
|
.object({
|
|
4
10
|
to: z.string(),
|
|
5
11
|
from: z.string(),
|
|
6
12
|
limit: z.number().optional(),
|
|
13
|
+
tracking: trackingSchema,
|
|
7
14
|
})
|
|
8
15
|
.loose();
|
package/dist/schemas/otp.d.ts
CHANGED
|
@@ -17,17 +17,48 @@ export declare const otpVerifySchema: z.ZodObject<{
|
|
|
17
17
|
export declare const otpResendSchema: z.ZodObject<{
|
|
18
18
|
otp_id: z.ZodString;
|
|
19
19
|
}, z.core.$loose>;
|
|
20
|
+
export declare const otpReverseServiceSchema: z.ZodEnum<{
|
|
21
|
+
sms: "sms";
|
|
22
|
+
imessage: "imessage";
|
|
23
|
+
}>;
|
|
20
24
|
export declare const otpReverseInitiateSchema: z.ZodObject<{
|
|
21
25
|
number: z.ZodString;
|
|
22
26
|
factor: z.ZodOptional<z.ZodString>;
|
|
23
27
|
to: z.ZodOptional<z.ZodString>;
|
|
28
|
+
service: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
sms: "sms";
|
|
30
|
+
imessage: "imessage";
|
|
31
|
+
}>>;
|
|
24
32
|
language: z.ZodOptional<z.ZodString>;
|
|
25
33
|
success_url: z.ZodOptional<z.ZodString>;
|
|
26
34
|
}, z.core.$loose>;
|
|
35
|
+
export type OtpReverseService = z.infer<typeof otpReverseServiceSchema>;
|
|
27
36
|
export type OtpSendParams = z.infer<typeof otpSendSchema>;
|
|
28
37
|
/** @deprecated Use OtpSendParams instead. */
|
|
29
38
|
export type OtpNewParams = OtpSendParams;
|
|
30
39
|
export type OtpVerifyParams = z.infer<typeof otpVerifySchema>;
|
|
31
40
|
export type OtpResendParams = z.infer<typeof otpResendSchema>;
|
|
32
41
|
export type OtpReverseInitiateParams = z.infer<typeof otpReverseInitiateSchema>;
|
|
42
|
+
export interface OtpReverseInitiateResponse {
|
|
43
|
+
otp_id: string;
|
|
44
|
+
number: string;
|
|
45
|
+
factor: string;
|
|
46
|
+
to: string;
|
|
47
|
+
service: OtpReverseService;
|
|
48
|
+
expires_at: string;
|
|
49
|
+
ui: {
|
|
50
|
+
text: string;
|
|
51
|
+
qr_code: string;
|
|
52
|
+
};
|
|
53
|
+
success_url: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface OtpReverseVerifyResponse {
|
|
56
|
+
otp_id: string;
|
|
57
|
+
status: "pending" | "verified" | "cancelled" | "expired";
|
|
58
|
+
expires_at: string;
|
|
59
|
+
}
|
|
60
|
+
export interface OtpReverseCancelResponse {
|
|
61
|
+
otp_id: string;
|
|
62
|
+
status: "cancelled";
|
|
63
|
+
}
|
|
33
64
|
//# sourceMappingURL=otp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../src/schemas/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;iBAA0F,CAAC;AACrH,6CAA6C;AAC7C,eAAO,MAAM,YAAY;;;;iBAAgB,CAAC;AAC1C,eAAO,MAAM,eAAe;;;iBAA4D,CAAC;AACzF,eAAO,MAAM,eAAe;;iBAA2C,CAAC;AACxE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../src/schemas/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;iBAA0F,CAAC;AACrH,6CAA6C;AAC7C,eAAO,MAAM,YAAY;;;;iBAAgB,CAAC;AAC1C,eAAO,MAAM,eAAe;;;iBAA4D,CAAC;AACzF,eAAO,MAAM,eAAe;;iBAA2C,CAAC;AACxE,eAAO,MAAM,uBAAuB;;;EAA8B,CAAC;AACnE,eAAO,MAAM,wBAAwB;;;;;;;;;;iBASzB,CAAC;AAEb,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;AACzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,MAAM,WAAW,0BAA0B;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE;QACA,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;CACvB"}
|
package/dist/schemas/otp.js
CHANGED
|
@@ -4,11 +4,13 @@ export const otpSendSchema = z.object({ to: z.string(), language: z.string(), na
|
|
|
4
4
|
export const otpNewSchema = otpSendSchema;
|
|
5
5
|
export const otpVerifySchema = z.object({ otp_id: z.string(), otp: z.string() }).loose();
|
|
6
6
|
export const otpResendSchema = z.object({ otp_id: z.string() }).loose();
|
|
7
|
+
export const otpReverseServiceSchema = z.enum(["sms", "imessage"]);
|
|
7
8
|
export const otpReverseInitiateSchema = z
|
|
8
9
|
.object({
|
|
9
10
|
number: z.string(),
|
|
10
11
|
factor: z.string().max(16).optional(),
|
|
11
12
|
to: z.string().optional(),
|
|
13
|
+
service: otpReverseServiceSchema.optional(),
|
|
12
14
|
language: z.string().optional(),
|
|
13
15
|
success_url: z.string().url().optional(),
|
|
14
16
|
})
|
package/dist/types/webhooks.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export interface TextDeliveryData {
|
|
|
39
39
|
timestamp: number;
|
|
40
40
|
error?: string;
|
|
41
41
|
}
|
|
42
|
+
/** otp.reverse.verified */
|
|
43
|
+
export interface OtpReverseVerifiedData {
|
|
44
|
+
otp_id: string;
|
|
45
|
+
number: string;
|
|
46
|
+
status: "verified";
|
|
47
|
+
}
|
|
42
48
|
/** Minimal data for reply() - has to/from. Used by text, imessage, whatsapp. */
|
|
43
49
|
export interface IncomingMessageData {
|
|
44
50
|
to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/types/webhooks.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,gBAAgB,GACtB,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;AAE/C,MAAM,WAAW,gBAAgB;IAC7B,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;CACjC;AAED,4CAA4C;AAC5C,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxE;AAED,wBAAwB;AACxB,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAA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