@crvouga/mockingbird-service-twilio 3.0.0 → 3.2.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/API_EVIDENCE.md +3 -0
- package/CHANGELOG.md +16 -4
- package/DISCOVERY.md +2 -2
- package/LICENSE_EMULATE +202 -0
- package/README.md +14 -14
- package/SUPPORT.md +72 -3
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/dist/{chunk-OINOWAF7.js → chunk-JGQUWBT2.js} +61 -7
- package/dist/chunk-JGQUWBT2.js.map +7 -0
- package/dist/chunk-M73LWCCP.js +67 -0
- package/dist/chunk-M73LWCCP.js.map +7 -0
- package/dist/{chunk-64B2VD5D.js → chunk-SOEDG3O2.js} +6837 -3224
- package/dist/chunk-SOEDG3O2.js.map +7 -0
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/crypto-I5AVO7Q3.js +15 -0
- package/dist/crypto-I5AVO7Q3.js.map +7 -0
- package/dist/helpers-BMHFVPFA.js +86 -0
- package/dist/helpers-BMHFVPFA.js.map +7 -0
- package/dist/index.d.ts +193 -59
- package/dist/index.js +2 -1
- package/dist/server.d.ts +272 -120
- package/dist/server.js +3 -2
- package/openapi.yaml +3604 -863
- package/package.json +16 -7
- package/routes.json +58 -0
- package/dist/chunk-64B2VD5D.js.map +0 -7
- package/dist/chunk-OINOWAF7.js.map +0 -7
package/dist/cli.js
CHANGED
package/dist/cli.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli.ts"],
|
|
4
4
|
"sourcesContent": ["#!/usr/bin/env node\n/// <reference types=\"node\" />\nimport { runCli, serveCommand } from \"@crvouga/mockingbird-adapter-node\"\nimport { serveTarget } from \"./server.js\"\n\nconst code = await runCli(\n {\n bin: \"mockingbird-twilio\",\n description: \"stateful Twilio Verify, Lookup, Messaging and Recordings mock\",\n commands: { serve: serveCommand(serveTarget) },\n },\n process.argv.slice(2),\n)\nif (code !== 0) process.exitCode = code\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;AAKA,IAAM,OAAO,MAAM;AAAA,EACjB;AAAA,IACE,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU,EAAE,OAAO,aAAa,WAAW,EAAE;AAAA,EAC/C;AAAA,EACA,QAAQ,KAAK,MAAM,CAAC;AACtB;AACA,IAAI,SAAS,EAAG,SAAQ,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHash,
|
|
3
|
+
createHmac,
|
|
4
|
+
randomBytes,
|
|
5
|
+
randomUUID,
|
|
6
|
+
timingSafeEqual
|
|
7
|
+
} from "./chunk-M73LWCCP.js";
|
|
8
|
+
export {
|
|
9
|
+
createHash,
|
|
10
|
+
createHmac,
|
|
11
|
+
randomBytes,
|
|
12
|
+
randomUUID,
|
|
13
|
+
timingSafeEqual
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=crypto-I5AVO7Q3.js.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
randomUUID
|
|
3
|
+
} from "./chunk-M73LWCCP.js";
|
|
4
|
+
|
|
5
|
+
// ../../http/provider/dist/vendor/clerk/helpers.js
|
|
6
|
+
function generateClerkId(prefix) {
|
|
7
|
+
const compact = randomUUID().replace(/-/g, "");
|
|
8
|
+
return `${prefix}${compact.slice(0, 24)}`;
|
|
9
|
+
}
|
|
10
|
+
function nowUnix(clockNow = Date.now) {
|
|
11
|
+
return Math.floor(clockNow() / 1e3);
|
|
12
|
+
}
|
|
13
|
+
function createDefaultUser(clockNow = Date.now) {
|
|
14
|
+
const now = nowUnix(clockNow);
|
|
15
|
+
return {
|
|
16
|
+
clerk_id: generateClerkId("user_"),
|
|
17
|
+
username: null,
|
|
18
|
+
first_name: "Test",
|
|
19
|
+
last_name: "User",
|
|
20
|
+
image_url: null,
|
|
21
|
+
profile_image_url: null,
|
|
22
|
+
external_id: null,
|
|
23
|
+
primary_email_address_id: null,
|
|
24
|
+
primary_phone_number_id: null,
|
|
25
|
+
password_enabled: true,
|
|
26
|
+
password_hash: "test_password",
|
|
27
|
+
totp_enabled: false,
|
|
28
|
+
backup_code_enabled: false,
|
|
29
|
+
two_factor_enabled: false,
|
|
30
|
+
banned: false,
|
|
31
|
+
locked: false,
|
|
32
|
+
public_metadata: {},
|
|
33
|
+
private_metadata: {},
|
|
34
|
+
unsafe_metadata: {},
|
|
35
|
+
last_active_at: null,
|
|
36
|
+
last_sign_in_at: null,
|
|
37
|
+
created_at_unix: now,
|
|
38
|
+
updated_at_unix: now
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function createDefaultEmailAddress(userId, email, primary, clockNow = Date.now) {
|
|
42
|
+
const now = nowUnix(clockNow);
|
|
43
|
+
return {
|
|
44
|
+
email_id: generateClerkId("idn_"),
|
|
45
|
+
email_address: email,
|
|
46
|
+
user_id: userId,
|
|
47
|
+
verification_status: "verified",
|
|
48
|
+
verification_strategy: "email_code",
|
|
49
|
+
is_primary: primary,
|
|
50
|
+
reserved: false,
|
|
51
|
+
created_at_unix: now,
|
|
52
|
+
updated_at_unix: now
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function createDefaultOrganization(clockNow = Date.now) {
|
|
56
|
+
const now = nowUnix(clockNow);
|
|
57
|
+
return {
|
|
58
|
+
clerk_id: generateClerkId("org_"),
|
|
59
|
+
name: "My Company",
|
|
60
|
+
slug: "my-company",
|
|
61
|
+
image_url: null,
|
|
62
|
+
has_logo: false,
|
|
63
|
+
members_count: 0,
|
|
64
|
+
pending_invitations_count: 0,
|
|
65
|
+
public_metadata: {},
|
|
66
|
+
private_metadata: {},
|
|
67
|
+
max_allowed_memberships: null,
|
|
68
|
+
admin_delete_enabled: true,
|
|
69
|
+
created_at_unix: now,
|
|
70
|
+
updated_at_unix: now
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function userDisplayName(user) {
|
|
74
|
+
const combined = [user.first_name, user.last_name].filter(Boolean).join(" ");
|
|
75
|
+
return combined || user.username || "User";
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
createDefaultEmailAddress,
|
|
79
|
+
createDefaultOrganization,
|
|
80
|
+
createDefaultUser,
|
|
81
|
+
generateClerkId,
|
|
82
|
+
nowUnix,
|
|
83
|
+
userDisplayName
|
|
84
|
+
};
|
|
85
|
+
/*! Adapted from vercel-labs/emulate (Apache-2.0), modified for Mockingbird. See port.json, LICENSE_EMULATE and THIRD_PARTY_NOTICES.md. */
|
|
86
|
+
//# sourceMappingURL=helpers-BMHFVPFA.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../http/provider/src/vendor/clerk/helpers.ts"],
|
|
4
|
+
"sourcesContent": ["/*! Adapted from vercel-labs/emulate (Apache-2.0), modified for Mockingbird. See port.json, LICENSE_EMULATE and THIRD_PARTY_NOTICES.md. */\nimport { randomUUID } from \"../core/crypto.js\";\nimport type { ClerkUser, ClerkEmailAddress, ClerkOrganization } from \"./entities.js\";\n\nexport function generateClerkId(prefix: string): string {\n const compact = randomUUID().replace(/-/g, \"\");\n return `${prefix}${compact.slice(0, 24)}`;\n}\n\nexport function nowUnix(clockNow: () => number = Date.now): number {\n return Math.floor(clockNow() / 1000);\n}\n\nexport function createDefaultUser(clockNow: () => number = Date.now): Omit<ClerkUser, \"id\" | \"created_at\" | \"updated_at\"> {\n const now = nowUnix(clockNow);\n return {\n clerk_id: generateClerkId(\"user_\"),\n username: null,\n first_name: \"Test\",\n last_name: \"User\",\n image_url: null,\n profile_image_url: null,\n external_id: null,\n primary_email_address_id: null,\n primary_phone_number_id: null,\n password_enabled: true,\n password_hash: \"test_password\",\n totp_enabled: false,\n backup_code_enabled: false,\n two_factor_enabled: false,\n banned: false,\n locked: false,\n public_metadata: {},\n private_metadata: {},\n unsafe_metadata: {},\n last_active_at: null,\n last_sign_in_at: null,\n created_at_unix: now,\n updated_at_unix: now,\n };\n}\n\nexport function createDefaultEmailAddress(\n userId: string,\n email: string,\n primary: boolean, clockNow: () => number = Date.now,\n): Omit<ClerkEmailAddress, \"id\" | \"created_at\" | \"updated_at\"> {\n const now = nowUnix(clockNow);\n return {\n email_id: generateClerkId(\"idn_\"),\n email_address: email,\n user_id: userId,\n verification_status: \"verified\",\n verification_strategy: \"email_code\",\n is_primary: primary,\n reserved: false,\n created_at_unix: now,\n updated_at_unix: now,\n };\n}\n\nexport function createDefaultOrganization(clockNow: () => number = Date.now): Omit<ClerkOrganization, \"id\" | \"created_at\" | \"updated_at\"> {\n const now = nowUnix(clockNow);\n return {\n clerk_id: generateClerkId(\"org_\"),\n name: \"My Company\",\n slug: \"my-company\",\n image_url: null,\n has_logo: false,\n members_count: 0,\n pending_invitations_count: 0,\n public_metadata: {},\n private_metadata: {},\n max_allowed_memberships: null,\n admin_delete_enabled: true,\n created_at_unix: now,\n updated_at_unix: now,\n };\n}\n\nexport function userDisplayName(user: Pick<ClerkUser, \"first_name\" | \"last_name\" | \"username\">): string {\n const combined = [user.first_name, user.last_name].filter(Boolean).join(\" \");\n return combined || user.username || \"User\";\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIM,SAAU,gBAAgB,QAAc;AAC5C,QAAM,UAAU,WAAU,EAAG,QAAQ,MAAM,EAAE;AAC7C,SAAO,GAAG,MAAM,GAAG,QAAQ,MAAM,GAAG,EAAE,CAAC;AACzC;AAEM,SAAU,QAAQ,WAAyB,KAAK,KAAG;AACvD,SAAO,KAAK,MAAM,SAAQ,IAAK,GAAI;AACrC;AAEM,SAAU,kBAAkB,WAAyB,KAAK,KAAG;AACjE,QAAM,MAAM,QAAQ,QAAQ;AAC5B,SAAO;IACL,UAAU,gBAAgB,OAAO;IACjC,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,mBAAmB;IACnB,aAAa;IACb,0BAA0B;IAC1B,yBAAyB;IACzB,kBAAkB;IAClB,eAAe;IACf,cAAc;IACd,qBAAqB;IACrB,oBAAoB;IACpB,QAAQ;IACR,QAAQ;IACR,iBAAiB,CAAA;IACjB,kBAAkB,CAAA;IAClB,iBAAiB,CAAA;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;;AAErB;AAEM,SAAU,0BACd,QACA,OACA,SAAkB,WAAyB,KAAK,KAAG;AAEnD,QAAM,MAAM,QAAQ,QAAQ;AAC5B,SAAO;IACL,UAAU,gBAAgB,MAAM;IAChC,eAAe;IACf,SAAS;IACT,qBAAqB;IACrB,uBAAuB;IACvB,YAAY;IACZ,UAAU;IACV,iBAAiB;IACjB,iBAAiB;;AAErB;AAEM,SAAU,0BAA0B,WAAyB,KAAK,KAAG;AACzE,QAAM,MAAM,QAAQ,QAAQ;AAC5B,SAAO;IACL,UAAU,gBAAgB,MAAM;IAChC,MAAM;IACN,MAAM;IACN,WAAW;IACX,UAAU;IACV,eAAe;IACf,2BAA2B;IAC3B,iBAAiB,CAAA;IACjB,kBAAkB,CAAA;IAClB,yBAAyB;IACzB,sBAAsB;IACtB,iBAAiB;IACjB,iBAAiB;;AAErB;AAEM,SAAU,gBAAgB,MAA8D;AAC5F,QAAM,WAAW,CAAC,KAAK,YAAY,KAAK,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAC3E,SAAO,YAAY,KAAK,YAAY;AACtC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ interface FetchAPI$1 {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
|
14
|
-
type SqliteValue$
|
|
14
|
+
type SqliteValue$2 = null | number | bigint | string | Uint8Array | boolean;
|
|
15
15
|
/** Mutation counters returned by {@link SqliteStatement.run}. */
|
|
16
|
-
type SqliteRunResult$
|
|
16
|
+
type SqliteRunResult$2 = {
|
|
17
17
|
changes: number;
|
|
18
18
|
lastInsertRowid: number | bigint;
|
|
19
19
|
};
|
|
@@ -22,10 +22,10 @@ type SqliteRunResult$1 = {
|
|
|
22
22
|
*
|
|
23
23
|
* Pass bind values as rest arguments on each call (no sticky `bind()`).
|
|
24
24
|
*/
|
|
25
|
-
interface SqliteStatement$
|
|
26
|
-
run(...params: SqliteValue$
|
|
27
|
-
all<T = Record<string, unknown>>(...params: SqliteValue$
|
|
28
|
-
get<T = Record<string, unknown>>(...params: SqliteValue$
|
|
25
|
+
interface SqliteStatement$2 {
|
|
26
|
+
run(...params: SqliteValue$2[]): SqliteRunResult$2;
|
|
27
|
+
all<T = Record<string, unknown>>(...params: SqliteValue$2[]): T[];
|
|
28
|
+
get<T = Record<string, unknown>>(...params: SqliteValue$2[]): T | undefined;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Sync SQLite client port owned by Mockingbird.
|
|
@@ -33,54 +33,109 @@ interface SqliteStatement$1 {
|
|
|
33
33
|
* Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
|
|
34
34
|
* `bun:sqlite` instances all work when they expose this surface.
|
|
35
35
|
*/
|
|
36
|
-
interface SqliteClient$
|
|
36
|
+
interface SqliteClient$2 {
|
|
37
37
|
exec(sql: string): void;
|
|
38
|
-
prepare(sql: string): SqliteStatement$
|
|
38
|
+
prepare(sql: string): SqliteStatement$2;
|
|
39
39
|
transaction<T>(fn: () => T): T;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
type
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
/** Options every provider constructor accepts. */
|
|
43
|
+
type APIOptions$1 = {
|
|
44
|
+
/** Sync SQLite client. Defaults to `@crvouga/mockingbird-service-sqlite`. */
|
|
45
|
+
sqlite?: SqliteClient$2;
|
|
46
|
+
/** Clock used for `created`-style fields. Default `Date.now`. */
|
|
47
|
+
now?: () => number;
|
|
48
|
+
/**
|
|
49
|
+
* Storage namespace for this instance's records. Instances sharing one SQLite
|
|
50
|
+
* client stay isolated when their namespaces differ. Defaults to the service name.
|
|
51
|
+
*/
|
|
52
|
+
namespace?: string;
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
|
|
55
|
+
interface AuthUser {
|
|
56
|
+
login: string;
|
|
57
|
+
id: number;
|
|
58
|
+
scopes: string[];
|
|
59
|
+
installation?: AuthInstallation;
|
|
60
|
+
}
|
|
61
|
+
interface AuthInstallation {
|
|
62
|
+
installationId: number;
|
|
63
|
+
appId: number;
|
|
64
|
+
accountId: number;
|
|
65
|
+
accountType: "User" | "Organization";
|
|
66
|
+
permissions: Record<string, string>;
|
|
67
|
+
repositoryIds: number[];
|
|
68
|
+
repositorySelection: "all" | "selected";
|
|
69
|
+
}
|
|
70
|
+
interface AuthFallback {
|
|
71
|
+
login: string;
|
|
72
|
+
id: number;
|
|
73
|
+
scopes: string[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface TwilioSeedConfig {
|
|
77
|
+
port?: number;
|
|
78
|
+
account?: {
|
|
79
|
+
sid?: string;
|
|
80
|
+
auth_token?: string;
|
|
81
|
+
friendly_name?: string;
|
|
82
|
+
status?: "active" | "suspended" | "closed";
|
|
83
|
+
};
|
|
84
|
+
api_keys?: Array<{
|
|
85
|
+
sid?: string;
|
|
86
|
+
secret: string;
|
|
87
|
+
friendly_name?: string;
|
|
88
|
+
}>;
|
|
89
|
+
phone_numbers?: Array<{
|
|
90
|
+
sid?: string;
|
|
91
|
+
phone_number: string;
|
|
92
|
+
friendly_name?: string;
|
|
93
|
+
sms_url?: string;
|
|
94
|
+
sms_method?: string;
|
|
95
|
+
voice_url?: string;
|
|
96
|
+
voice_method?: string;
|
|
97
|
+
status_callback?: string;
|
|
98
|
+
}>;
|
|
99
|
+
messaging_services?: Array<{
|
|
100
|
+
sid?: string;
|
|
101
|
+
friendly_name: string;
|
|
102
|
+
phone_numbers?: string[];
|
|
103
|
+
status_callback?: string;
|
|
104
|
+
inbound_request_url?: string;
|
|
81
105
|
}>;
|
|
106
|
+
verify_services?: Array<{
|
|
107
|
+
sid?: string;
|
|
108
|
+
friendly_name: string;
|
|
109
|
+
code?: string;
|
|
110
|
+
default_channel?: string;
|
|
111
|
+
}>;
|
|
112
|
+
conversations?: {
|
|
113
|
+
services?: Array<{
|
|
114
|
+
sid?: string;
|
|
115
|
+
friendly_name: string;
|
|
116
|
+
}>;
|
|
117
|
+
};
|
|
82
118
|
}
|
|
83
119
|
|
|
120
|
+
type ProviderOptions = APIOptions$1 & {
|
|
121
|
+
baseUrl?: string;
|
|
122
|
+
tokens?: Record<string, AuthUser>;
|
|
123
|
+
fallbackUser?: AuthFallback;
|
|
124
|
+
publicNamespace?: string;
|
|
125
|
+
adminPrefix?: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type MountedAPI = FetchAPI & {
|
|
129
|
+
readonly prefix: string;
|
|
130
|
+
GET: FetchHandler;
|
|
131
|
+
POST: FetchHandler;
|
|
132
|
+
PUT: FetchHandler;
|
|
133
|
+
PATCH: FetchHandler;
|
|
134
|
+
DELETE: FetchHandler;
|
|
135
|
+
HEAD: FetchHandler;
|
|
136
|
+
OPTIONS: FetchHandler;
|
|
137
|
+
};
|
|
138
|
+
|
|
84
139
|
/** A stable identifier for a point in a {@link Timeline}. */
|
|
85
140
|
type CheckpointId = string;
|
|
86
141
|
/** An immutable node in a timeline's checkpoint DAG. */
|
|
@@ -170,6 +225,79 @@ declare class Timeline<T> {
|
|
|
170
225
|
interface FetchAPI {
|
|
171
226
|
fetch(request: Request): Promise<Response>;
|
|
172
227
|
}
|
|
228
|
+
/** A bare function form of {@link FetchAPI}, compatible with `Bun.serve`, workerd, and Deno. */
|
|
229
|
+
type FetchHandler = (request: Request) => Promise<Response>;
|
|
230
|
+
|
|
231
|
+
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
|
232
|
+
type SqliteValue$1 = null | number | bigint | string | Uint8Array | boolean;
|
|
233
|
+
/** Mutation counters returned by {@link SqliteStatement.run}. */
|
|
234
|
+
type SqliteRunResult$1 = {
|
|
235
|
+
changes: number;
|
|
236
|
+
lastInsertRowid: number | bigint;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Prepared statement bound to a {@link SqliteClient}.
|
|
240
|
+
*
|
|
241
|
+
* Pass bind values as rest arguments on each call (no sticky `bind()`).
|
|
242
|
+
*/
|
|
243
|
+
interface SqliteStatement$1 {
|
|
244
|
+
run(...params: SqliteValue$1[]): SqliteRunResult$1;
|
|
245
|
+
all<T = Record<string, unknown>>(...params: SqliteValue$1[]): T[];
|
|
246
|
+
get<T = Record<string, unknown>>(...params: SqliteValue$1[]): T | undefined;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Sync SQLite client port owned by Mockingbird.
|
|
250
|
+
*
|
|
251
|
+
* Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
|
|
252
|
+
* `bun:sqlite` instances all work when they expose this surface.
|
|
253
|
+
*/
|
|
254
|
+
interface SqliteClient$1 {
|
|
255
|
+
exec(sql: string): void;
|
|
256
|
+
prepare(sql: string): SqliteStatement$1;
|
|
257
|
+
transaction<T>(fn: () => T): T;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Every stored record carries a monotonically increasing sequence for stable ordering. */
|
|
261
|
+
type Stored<T> = {
|
|
262
|
+
seq: number;
|
|
263
|
+
value: T;
|
|
264
|
+
};
|
|
265
|
+
type ListRecordsOptions<T> = {
|
|
266
|
+
/** Keep only records passing the predicate. */
|
|
267
|
+
where?: (value: T, seq: number) => boolean;
|
|
268
|
+
/** Sort order; default newest first. */
|
|
269
|
+
order?: "newest" | "oldest";
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
|
|
273
|
+
* sequence, never by id lexicographic order, so list semantics stay stable.
|
|
274
|
+
*/
|
|
275
|
+
declare class Collection<T> {
|
|
276
|
+
private readonly sqlite;
|
|
277
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
278
|
+
readonly namespace: string;
|
|
279
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
280
|
+
readonly collectionName: string;
|
|
281
|
+
constructor(sqlite: SqliteClient$1,
|
|
282
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
283
|
+
namespace: string,
|
|
284
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
285
|
+
collectionName: string);
|
|
286
|
+
private bumpCollectionSeq;
|
|
287
|
+
nextSequence(): number;
|
|
288
|
+
get(id: string): T | undefined;
|
|
289
|
+
has(id: string): boolean;
|
|
290
|
+
/** Insert a new record, assigning it the next sequence number. */
|
|
291
|
+
insert(id: string, value: T): Stored<T>;
|
|
292
|
+
/** Replace an existing record's value, keeping its position. */
|
|
293
|
+
update(id: string, value: T): Stored<T> | undefined;
|
|
294
|
+
delete(id: string): boolean;
|
|
295
|
+
/** How many records the collection holds, without reading them. */
|
|
296
|
+
count(): number;
|
|
297
|
+
list(options?: ListRecordsOptions<T>): Array<Stored<T> & {
|
|
298
|
+
id: string;
|
|
299
|
+
}>;
|
|
300
|
+
}
|
|
173
301
|
|
|
174
302
|
/** Options every provider constructor accepts. */
|
|
175
303
|
type APIOptions = {
|
|
@@ -612,6 +740,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
612
740
|
/** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
|
|
613
741
|
stop?(): void;
|
|
614
742
|
readonly name: string;
|
|
743
|
+
/** Same-origin Fetch handler and App Router method exports, sharing this runtime. */
|
|
744
|
+
mount(prefix: string): MountedAPI;
|
|
615
745
|
readonly sqlite: SqliteClient$1;
|
|
616
746
|
readonly clock: Clock;
|
|
617
747
|
readonly faults: FaultRegistry;
|
|
@@ -772,17 +902,17 @@ type MessageRecord = {
|
|
|
772
902
|
to: string;
|
|
773
903
|
from: string | null;
|
|
774
904
|
messaging_service_sid: string | null;
|
|
775
|
-
status: "queued" | "
|
|
776
|
-
direction: "outbound-api";
|
|
905
|
+
status: "accepted" | "scheduled" | "canceled" | "queued" | "sending" | "sent" | "failed" | "delivered" | "undelivered" | "receiving" | "received" | "read";
|
|
906
|
+
direction: "inbound" | "outbound-api" | "outbound-call" | "outbound-reply";
|
|
777
907
|
num_segments: string;
|
|
778
908
|
num_media: string;
|
|
779
|
-
price: null;
|
|
909
|
+
price: string | null;
|
|
780
910
|
price_unit: "USD";
|
|
781
|
-
error_code: null;
|
|
782
|
-
error_message: null;
|
|
911
|
+
error_code: number | null;
|
|
912
|
+
error_message: string | null;
|
|
783
913
|
date_created: string;
|
|
784
914
|
date_updated: string;
|
|
785
|
-
date_sent: null;
|
|
915
|
+
date_sent: string | null;
|
|
786
916
|
uri: string;
|
|
787
917
|
subresource_uris: {
|
|
788
918
|
media: string;
|
|
@@ -1017,10 +1147,10 @@ type OpenAPIDocument = {
|
|
|
1017
1147
|
};
|
|
1018
1148
|
|
|
1019
1149
|
declare const document: OpenAPIDocument;
|
|
1020
|
-
type OperationId = "FetchPhoneNumber" | "CreateVerification" | "FetchVerification" | "UpdateVerification" | "CreateVerificationCheck" | "ListMessages" | "CreateMessage" | "FetchMessage" | "FetchRecordingMedia" | "FetchRecording" | "DeleteRecording";
|
|
1021
|
-
type SupportedOperationId = "FetchPhoneNumber" | "CreateVerification" | "FetchVerification" | "UpdateVerification" | "CreateVerificationCheck" | "ListMessages" | "CreateMessage" | "FetchMessage" | "FetchRecordingMedia" | "FetchRecording" | "DeleteRecording";
|
|
1022
|
-
declare const operationIds: readonly ["FetchPhoneNumber", "CreateVerification", "FetchVerification", "UpdateVerification", "CreateVerificationCheck", "ListMessages", "CreateMessage", "FetchMessage", "FetchRecordingMedia", "FetchRecording", "DeleteRecording"];
|
|
1023
|
-
declare const supportedOperationIds: readonly ["FetchPhoneNumber", "CreateVerification", "FetchVerification", "UpdateVerification", "CreateVerificationCheck", "ListMessages", "CreateMessage", "FetchMessage", "FetchRecordingMedia", "FetchRecording", "DeleteRecording"];
|
|
1150
|
+
type OperationId = "FetchPhoneNumber" | "CreateVerification" | "FetchVerification" | "UpdateVerification" | "CreateVerificationCheck" | "ListMessages" | "CreateMessage" | "FetchMessage" | "POST /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json" | "FetchRecordingMedia" | "FetchRecording" | "DeleteRecording" | "GET /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "POST /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "DELETE /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "DELETE /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "POST /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "DELETE /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "DELETE /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "GET /messaging/v1/Services/:serviceSid" | "POST /messaging/v1/Services/:serviceSid" | "DELETE /messaging/v1/Services/:serviceSid" | "DELETE /messaging/v1/Services/:serviceSid/PhoneNumbers/:sid" | "GET /verify/v2/Services/:serviceSid" | "POST /verify/v2/Services/:serviceSid" | "DELETE /verify/v2/Services/:serviceSid" | "GET /" | "GET /2010-04-01/Accounts.json" | "GET /2010-04-01/Accounts/:accountSid.json" | "POST /2010-04-01/Accounts/:accountSid.json" | "GET /2010-04-01/Accounts/:accountSid/Calls.json" | "POST /2010-04-01/Accounts/:accountSid/Calls.json" | "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json" | "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json" | "GET /2010-04-01/Accounts/:accountSid/Messages.json" | "POST /2010-04-01/Accounts/:accountSid/Messages.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media/:mediaSid.json" | "GET /_twilio/simulate/verification-code" | "GET /conversations/v1/Services" | "POST /conversations/v1/Services" | "GET /conversations/v1/Services/:serviceSid" | "GET /conversations/v1/Services/:serviceSid/Conversations" | "POST /conversations/v1/Services/:serviceSid/Conversations" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants" | "GET /messaging/v1/Services" | "POST /messaging/v1/Services" | "GET /messaging/v1/Services/:serviceSid/PhoneNumbers" | "POST /messaging/v1/Services/:serviceSid/PhoneNumbers" | "GET /verify/v2/Services" | "POST /verify/v2/Services" | "POST /_twilio/simulate/call-status" | "POST /_twilio/simulate/inbound-call" | "POST /_twilio/simulate/inbound-message" | "POST /_twilio/simulate/message-status" | "POST /_twilio/simulate/verification-status" | "GET /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "GET /api/2010-04-01/Accounts.json" | "GET /api/2010-04-01/Accounts/{accountSid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Calls.json" | "POST /api/2010-04-01/Accounts/{accountSid}/Calls.json" | "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json" | "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media/{mediaSid}.json";
|
|
1151
|
+
type SupportedOperationId = "FetchPhoneNumber" | "CreateVerification" | "FetchVerification" | "UpdateVerification" | "CreateVerificationCheck" | "ListMessages" | "CreateMessage" | "FetchMessage" | "POST /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json" | "FetchRecordingMedia" | "FetchRecording" | "DeleteRecording" | "GET /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "POST /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "DELETE /2010-04-01/Accounts/:accountSid/Calls/:callSid.json" | "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "DELETE /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "POST /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "DELETE /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "DELETE /conversations/v1/Services/:serviceSid/Conversations/:conversationSid" | "GET /messaging/v1/Services/:serviceSid" | "POST /messaging/v1/Services/:serviceSid" | "DELETE /messaging/v1/Services/:serviceSid" | "DELETE /messaging/v1/Services/:serviceSid/PhoneNumbers/:sid" | "GET /verify/v2/Services/:serviceSid" | "POST /verify/v2/Services/:serviceSid" | "DELETE /verify/v2/Services/:serviceSid" | "GET /" | "GET /2010-04-01/Accounts.json" | "GET /2010-04-01/Accounts/:accountSid.json" | "POST /2010-04-01/Accounts/:accountSid.json" | "GET /2010-04-01/Accounts/:accountSid/Calls.json" | "POST /2010-04-01/Accounts/:accountSid/Calls.json" | "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json" | "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json" | "GET /2010-04-01/Accounts/:accountSid/Messages.json" | "POST /2010-04-01/Accounts/:accountSid/Messages.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media.json" | "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media/:mediaSid.json" | "GET /_twilio/simulate/verification-code" | "GET /conversations/v1/Services" | "POST /conversations/v1/Services" | "GET /conversations/v1/Services/:serviceSid" | "GET /conversations/v1/Services/:serviceSid/Conversations" | "POST /conversations/v1/Services/:serviceSid/Conversations" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages" | "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants" | "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants" | "GET /messaging/v1/Services" | "POST /messaging/v1/Services" | "GET /messaging/v1/Services/:serviceSid/PhoneNumbers" | "POST /messaging/v1/Services/:serviceSid/PhoneNumbers" | "GET /verify/v2/Services" | "POST /verify/v2/Services" | "POST /_twilio/simulate/call-status" | "POST /_twilio/simulate/inbound-call" | "POST /_twilio/simulate/inbound-message" | "POST /_twilio/simulate/message-status" | "POST /_twilio/simulate/verification-status" | "GET /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json" | "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "DELETE /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json" | "GET /api/2010-04-01/Accounts.json" | "GET /api/2010-04-01/Accounts/{accountSid}.json" | "POST /api/2010-04-01/Accounts/{accountSid}.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Calls.json" | "POST /api/2010-04-01/Accounts/{accountSid}/Calls.json" | "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json" | "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media.json" | "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media/{mediaSid}.json";
|
|
1152
|
+
declare const operationIds: readonly ["FetchPhoneNumber", "CreateVerification", "FetchVerification", "UpdateVerification", "CreateVerificationCheck", "ListMessages", "CreateMessage", "FetchMessage", "POST /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json", "FetchRecordingMedia", "FetchRecording", "DeleteRecording", "GET /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "POST /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "DELETE /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "DELETE /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "POST /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "DELETE /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "DELETE /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "GET /messaging/v1/Services/:serviceSid", "POST /messaging/v1/Services/:serviceSid", "DELETE /messaging/v1/Services/:serviceSid", "DELETE /messaging/v1/Services/:serviceSid/PhoneNumbers/:sid", "GET /verify/v2/Services/:serviceSid", "POST /verify/v2/Services/:serviceSid", "DELETE /verify/v2/Services/:serviceSid", "GET /", "GET /2010-04-01/Accounts.json", "GET /2010-04-01/Accounts/:accountSid.json", "POST /2010-04-01/Accounts/:accountSid.json", "GET /2010-04-01/Accounts/:accountSid/Calls.json", "POST /2010-04-01/Accounts/:accountSid/Calls.json", "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json", "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json", "GET /2010-04-01/Accounts/:accountSid/Messages.json", "POST /2010-04-01/Accounts/:accountSid/Messages.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media/:mediaSid.json", "GET /_twilio/simulate/verification-code", "GET /conversations/v1/Services", "POST /conversations/v1/Services", "GET /conversations/v1/Services/:serviceSid", "GET /conversations/v1/Services/:serviceSid/Conversations", "POST /conversations/v1/Services/:serviceSid/Conversations", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants", "GET /messaging/v1/Services", "POST /messaging/v1/Services", "GET /messaging/v1/Services/:serviceSid/PhoneNumbers", "POST /messaging/v1/Services/:serviceSid/PhoneNumbers", "GET /verify/v2/Services", "POST /verify/v2/Services", "POST /_twilio/simulate/call-status", "POST /_twilio/simulate/inbound-call", "POST /_twilio/simulate/inbound-message", "POST /_twilio/simulate/message-status", "POST /_twilio/simulate/verification-status", "GET /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "POST /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "GET /api/2010-04-01/Accounts.json", "GET /api/2010-04-01/Accounts/{accountSid}.json", "POST /api/2010-04-01/Accounts/{accountSid}.json", "GET /api/2010-04-01/Accounts/{accountSid}/Calls.json", "POST /api/2010-04-01/Accounts/{accountSid}/Calls.json", "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json", "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json", "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media.json", "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media/{mediaSid}.json"];
|
|
1153
|
+
declare const supportedOperationIds: readonly ["FetchPhoneNumber", "CreateVerification", "FetchVerification", "UpdateVerification", "CreateVerificationCheck", "ListMessages", "CreateMessage", "FetchMessage", "POST /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}.json", "FetchRecordingMedia", "FetchRecording", "DeleteRecording", "GET /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "POST /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "DELETE /2010-04-01/Accounts/:accountSid/Calls/:callSid.json", "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "DELETE /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers/:sid.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "POST /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "DELETE /2010-04-01/Accounts/:accountSid/Messages/:messageSid.json", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "DELETE /conversations/v1/Services/:serviceSid/Conversations/:conversationSid", "GET /messaging/v1/Services/:serviceSid", "POST /messaging/v1/Services/:serviceSid", "DELETE /messaging/v1/Services/:serviceSid", "DELETE /messaging/v1/Services/:serviceSid/PhoneNumbers/:sid", "GET /verify/v2/Services/:serviceSid", "POST /verify/v2/Services/:serviceSid", "DELETE /verify/v2/Services/:serviceSid", "GET /", "GET /2010-04-01/Accounts.json", "GET /2010-04-01/Accounts/:accountSid.json", "POST /2010-04-01/Accounts/:accountSid.json", "GET /2010-04-01/Accounts/:accountSid/Calls.json", "POST /2010-04-01/Accounts/:accountSid/Calls.json", "GET /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json", "POST /2010-04-01/Accounts/:accountSid/IncomingPhoneNumbers.json", "GET /2010-04-01/Accounts/:accountSid/Messages.json", "POST /2010-04-01/Accounts/:accountSid/Messages.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media.json", "GET /2010-04-01/Accounts/:accountSid/Messages/:messageSid/Media/:mediaSid.json", "GET /_twilio/simulate/verification-code", "GET /conversations/v1/Services", "POST /conversations/v1/Services", "GET /conversations/v1/Services/:serviceSid", "GET /conversations/v1/Services/:serviceSid/Conversations", "POST /conversations/v1/Services/:serviceSid/Conversations", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Messages", "GET /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants", "POST /conversations/v1/Services/:serviceSid/Conversations/:conversationSid/Participants", "GET /messaging/v1/Services", "POST /messaging/v1/Services", "GET /messaging/v1/Services/:serviceSid/PhoneNumbers", "POST /messaging/v1/Services/:serviceSid/PhoneNumbers", "GET /verify/v2/Services", "POST /verify/v2/Services", "POST /_twilio/simulate/call-status", "POST /_twilio/simulate/inbound-call", "POST /_twilio/simulate/inbound-message", "POST /_twilio/simulate/message-status", "POST /_twilio/simulate/verification-status", "GET /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "POST /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/Calls/{callSid}.json", "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "DELETE /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers/{sid}.json", "GET /api/2010-04-01/Accounts.json", "GET /api/2010-04-01/Accounts/{accountSid}.json", "POST /api/2010-04-01/Accounts/{accountSid}.json", "GET /api/2010-04-01/Accounts/{accountSid}/Calls.json", "POST /api/2010-04-01/Accounts/{accountSid}/Calls.json", "GET /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json", "POST /api/2010-04-01/Accounts/{accountSid}/IncomingPhoneNumbers.json", "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media.json", "GET /api/2010-04-01/Accounts/{accountSid}/Messages/{messageSid}/Media/{mediaSid}.json"];
|
|
1024
1154
|
|
|
1025
1155
|
/**
|
|
1026
1156
|
* Routing Twilio's per-product hosts onto one mock origin.
|
|
@@ -1031,7 +1161,7 @@ declare const supportedOperationIds: readonly ["FetchPhoneNumber", "CreateVerifi
|
|
|
1031
1161
|
* `{mock}/verify/v2/…`, `{mock}/lookups/v2/…`, `{mock}/api/2010-04-01/…`.
|
|
1032
1162
|
*/
|
|
1033
1163
|
/** The products the mock serves, by their host's first label. */
|
|
1034
|
-
declare const TWILIO_PRODUCTS: readonly ["api", "verify", "lookups"];
|
|
1164
|
+
declare const TWILIO_PRODUCTS: readonly ["api", "verify", "lookups", "messaging", "conversations"];
|
|
1035
1165
|
/**
|
|
1036
1166
|
* The mock URL for an upstream Twilio URL: `https://verify.twilio.com/v2/Services/VA…/Verifications`
|
|
1037
1167
|
* with base `http://127.0.0.1:8798` becomes `http://127.0.0.1:8798/verify/v2/Services/VA…/Verifications`.
|
|
@@ -1100,7 +1230,7 @@ type TwilioAppWebhooks = {
|
|
|
1100
1230
|
/** `MessagingServiceSid` of inbound SMS, when the number belongs to one. */
|
|
1101
1231
|
messagingServiceSid?: string;
|
|
1102
1232
|
};
|
|
1103
|
-
type TwilioRuntimeOptions = {
|
|
1233
|
+
type TwilioRuntimeOptions = Pick<TwilioAPIOptions, "fixtures" | "baseUrl" | "tokens"> & {
|
|
1104
1234
|
sqlite?: SqliteClient;
|
|
1105
1235
|
clock?: Clock;
|
|
1106
1236
|
seed?: number | string;
|
|
@@ -1163,7 +1293,8 @@ declare const createRuntime: (options?: TwilioRuntimeOptions) => TwilioRuntime;
|
|
|
1163
1293
|
declare const TWILIO_NAMESPACE = "twilio";
|
|
1164
1294
|
/** The account sid used when a request carries an API key (`SK…`) instead of an account sid. */
|
|
1165
1295
|
declare const DEFAULT_ACCOUNT_SID = "AC00000000000000000000000000000000";
|
|
1166
|
-
type TwilioAPIOptions = APIOptions & {
|
|
1296
|
+
type TwilioAPIOptions = APIOptions & Pick<ProviderOptions, "tokens" | "baseUrl" | "publicNamespace" | "adminPrefix"> & {
|
|
1297
|
+
fixtures?: TwilioSeedConfig;
|
|
1167
1298
|
/** Initial Verify settings for the namespace (fixed code, expiry, attempt limits). */
|
|
1168
1299
|
verify?: Partial<VerifySettings>;
|
|
1169
1300
|
/**
|
|
@@ -1204,11 +1335,14 @@ declare class TwilioAPI implements FetchAPI$1 {
|
|
|
1204
1335
|
readonly app: Hono;
|
|
1205
1336
|
readonly sqlite: SqliteClient;
|
|
1206
1337
|
readonly state: TwilioState;
|
|
1338
|
+
private tail;
|
|
1339
|
+
private readonly expansion;
|
|
1207
1340
|
private readonly service;
|
|
1208
1341
|
private readonly now;
|
|
1209
1342
|
private readonly accounts;
|
|
1210
1343
|
constructor(options?: TwilioAPIOptions);
|
|
1211
1344
|
fetch(request: Request): Promise<Response>;
|
|
1345
|
+
private handleFetch;
|
|
1212
1346
|
reset(): Promise<void>;
|
|
1213
1347
|
private authenticate;
|
|
1214
1348
|
/** The account a request acts for: the path's, else the Basic username when it is one. */
|