@wats/graph 0.3.1 → 0.3.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/dist/client.d.ts +2 -2
- package/dist/client.js +3 -3
- package/dist/createFetchTransport.d.ts +1 -1
- package/dist/createFetchTransport.js +1 -1
- package/dist/createMockTransport.d.ts +1 -1
- package/dist/endpoint.d.ts +1 -1
- package/dist/endpoint.js +1 -1
- package/dist/endpoints/businessManagement.d.ts +153 -9
- package/dist/endpoints/businessManagement.js +279 -7
- package/dist/endpoints/calling.d.ts +7 -7
- package/dist/endpoints/calling.js +2 -2
- package/dist/endpoints/flows/callables.d.ts +10 -10
- package/dist/endpoints/flows/callables.js +2 -2
- package/dist/endpoints/flows/dataExchange.d.ts +1 -1
- package/dist/endpoints/flows/dataExchange.js +2 -2
- package/dist/endpoints/flows/flowJson.d.ts +1 -1
- package/dist/endpoints/flows/flowJson.js +1 -1
- package/dist/endpoints/flows/index.d.ts +6 -6
- package/dist/endpoints/flows/index.js +4 -4
- package/dist/endpoints/flows/shared.d.ts +1 -1
- package/dist/endpoints/flows/shared.js +1 -1
- package/dist/endpoints/flows/types.d.ts +1 -1
- package/dist/endpoints/flows.d.ts +2 -2
- package/dist/endpoints/flows.js +1 -1
- package/dist/endpoints/media.d.ts +1 -1
- package/dist/endpoints/media.js +1 -1
- package/dist/endpoints/messages/builders-basic.d.ts +11 -0
- package/dist/endpoints/messages/builders-basic.js +272 -0
- package/dist/endpoints/messages/builders-interactive.d.ts +11 -0
- package/dist/endpoints/messages/builders-interactive.js +156 -0
- package/dist/endpoints/messages/builders-template.d.ts +3 -0
- package/dist/endpoints/messages/builders-template.js +121 -0
- package/dist/endpoints/messages/callables.d.ts +31 -0
- package/dist/endpoints/messages/callables.js +57 -0
- package/dist/endpoints/messages/index.d.ts +6 -0
- package/dist/endpoints/messages/index.js +56 -0
- package/dist/endpoints/messages/types.d.ts +363 -0
- package/dist/endpoints/messages/types.js +0 -0
- package/dist/endpoints/messages/validation.d.ts +43 -0
- package/dist/endpoints/messages/validation.js +277 -0
- package/dist/endpoints/messages.d.ts +1 -375
- package/dist/endpoints/messages.js +1 -675
- package/dist/endpoints/templates/builders.d.ts +1 -1
- package/dist/endpoints/templates/builders.js +24 -1
- package/dist/endpoints/templates/callables.d.ts +7 -6
- package/dist/endpoints/templates/callables.js +7 -5
- package/dist/endpoints/templates/groups.d.ts +126 -0
- package/dist/endpoints/templates/groups.js +156 -0
- package/dist/endpoints/templates/index.d.ts +7 -5
- package/dist/endpoints/templates/index.js +11 -3
- package/dist/endpoints/templates/shared.d.ts +2 -2
- package/dist/endpoints/templates/shared.js +1 -1
- package/dist/endpoints/templates/types.d.ts +15 -2
- package/dist/endpoints/templates/validation.d.ts +1 -1
- package/dist/endpoints/templates/validation.js +2 -2
- package/dist/endpoints/templates.d.ts +2 -2
- package/dist/endpoints/templates.js +7 -1
- package/dist/endpoints/waba/index.d.ts +4 -4
- package/dist/endpoints/waba/index.js +1 -1
- package/dist/endpoints/waba/phoneNumbers.d.ts +6 -4
- package/dist/endpoints/waba/phoneNumbers.js +3 -3
- package/dist/endpoints/wabaEndpoints.d.ts +6 -6
- package/dist/endpoints/wabaEndpoints.js +9 -3
- package/dist/errorRegistry.d.ts +1 -1
- package/dist/errorSubclasses.d.ts +30 -2
- package/dist/errorSubclasses.js +65 -2
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +15 -15
- package/dist/internal/validation/arrays.js +2 -2
- package/dist/internal/validation/errors.d.ts +1 -1
- package/dist/internal/validation/errors.js +1 -1
- package/dist/internal/validation/headers.js +3 -3
- package/dist/internal/validation/index.d.ts +8 -8
- package/dist/internal/validation/index.js +8 -8
- package/dist/internal/validation/json.js +4 -4
- package/dist/internal/validation/options.js +2 -2
- package/dist/internal/validation/paths.js +2 -2
- package/dist/internal/validation/records.js +2 -2
- package/dist/internal/validation/strings.js +1 -1
- package/dist/pagination.d.ts +2 -2
- package/dist/subclients/phoneNumberClient.d.ts +21 -5
- package/dist/subclients/phoneNumberClient.js +78 -7
- package/dist/subclients/wabaClient.d.ts +19 -5
- package/dist/subclients/wabaClient.js +39 -6
- package/package.json +10 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GraphMessagesEndpoint } from "./endpoints/messages";
|
|
2
|
-
import type { Transport, TransportResponse } from "./transport";
|
|
1
|
+
import { GraphMessagesEndpoint } from "./endpoints/messages.js";
|
|
2
|
+
import type { Transport, TransportResponse } from "./transport.js";
|
|
3
3
|
export declare const DEFAULT_GRAPH_BASE_URL = "https://graph.facebook.com/";
|
|
4
4
|
export interface GraphClientConfig {
|
|
5
5
|
accessToken: string;
|
package/dist/client.js
CHANGED
|
@@ -202,9 +202,9 @@ import {
|
|
|
202
202
|
GraphSerializationError,
|
|
203
203
|
isGraphApiErrorPayload,
|
|
204
204
|
isGraphErrorEnvelope
|
|
205
|
-
} from "./errors";
|
|
206
|
-
import { GraphMessagesEndpoint } from "./endpoints/messages";
|
|
207
|
-
import { createFetchTransport } from "./createFetchTransport";
|
|
205
|
+
} from "./errors.js";
|
|
206
|
+
import { GraphMessagesEndpoint } from "./endpoints/messages.js";
|
|
207
|
+
import { createFetchTransport } from "./createFetchTransport.js";
|
|
208
208
|
export const DEFAULT_GRAPH_BASE_URL = "https://graph.facebook.com/";
|
|
209
209
|
const ACCESS_TOKEN_MAX_LEN = 4096;
|
|
210
210
|
const API_VERSION_REGEXP = /^v\d+(?:\.\d+)?$/;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Transport, TransportInterceptor } from "./transport";
|
|
1
|
+
import type { Transport, TransportInterceptor } from "./transport.js";
|
|
2
2
|
export interface CreateFetchTransportOptions {
|
|
3
3
|
readonly fetch?: typeof globalThis.fetch;
|
|
4
4
|
readonly interceptors?: readonly TransportInterceptor[];
|
package/dist/endpoint.d.ts
CHANGED
package/dist/endpoint.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type EndpointInvokeOptions } from "../endpoint";
|
|
2
|
-
import type { GraphClient } from "../client";
|
|
3
|
-
import type { GraphPaging } from "./waba/types";
|
|
1
|
+
import { type EndpointInvokeOptions } from "../endpoint.js";
|
|
2
|
+
import type { GraphClient } from "../client.js";
|
|
3
|
+
import type { GraphPaging } from "./waba/types.js";
|
|
4
4
|
export type BusinessManagementFields = string | readonly string[];
|
|
5
5
|
export interface WabaInfo {
|
|
6
6
|
readonly id?: string;
|
|
@@ -12,6 +12,8 @@ export interface WabaInfo {
|
|
|
12
12
|
readonly is_enabled_for_insights?: boolean;
|
|
13
13
|
readonly marketing_messages_lite_api_status?: string;
|
|
14
14
|
readonly marketing_messages_onboarding_status?: string;
|
|
15
|
+
/** WATS-91 / Graph v24+ portfolio-level messaging limit. */
|
|
16
|
+
readonly whatsapp_business_manager_messaging_limit?: string;
|
|
15
17
|
readonly ownership_type?: string;
|
|
16
18
|
readonly health_status?: unknown;
|
|
17
19
|
readonly currency?: string;
|
|
@@ -38,9 +40,15 @@ export interface PhoneNumberInfo {
|
|
|
38
40
|
readonly verified_name?: string;
|
|
39
41
|
readonly quality_rating?: string;
|
|
40
42
|
readonly code_verification_status?: string;
|
|
43
|
+
/** WATS-95 display-name certification status when requested via `fields=name_status`. */
|
|
44
|
+
readonly name_status?: string;
|
|
41
45
|
readonly platform_type?: string;
|
|
42
46
|
readonly throughput?: unknown;
|
|
43
47
|
readonly webhook_configuration?: unknown;
|
|
48
|
+
/** Graph phone-number field; v24+ semantics return the business-portfolio messaging limit. */
|
|
49
|
+
readonly messaging_limit_tier?: string;
|
|
50
|
+
/** WATS-91 / Graph v24+ explicit portfolio-level messaging limit field. */
|
|
51
|
+
readonly whatsapp_business_manager_messaging_limit?: string;
|
|
44
52
|
readonly [key: string]: unknown;
|
|
45
53
|
}
|
|
46
54
|
export interface PhoneNumberSettingsEntry {
|
|
@@ -101,6 +109,94 @@ export interface GetPhoneNumberSettingsInput {
|
|
|
101
109
|
/** Maps to Graph query parameter `include_sip_credentials`; responses may contain sensitive SIP credentials. */
|
|
102
110
|
readonly includeSipCredentials?: boolean;
|
|
103
111
|
}
|
|
112
|
+
export interface StorageConfigurationInput {
|
|
113
|
+
readonly status: "ENABLED" | "DISABLED" | string;
|
|
114
|
+
readonly [key: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
export interface UpdatePhoneNumberSettingsInput {
|
|
117
|
+
readonly phoneNumberId: string;
|
|
118
|
+
readonly storageConfiguration?: StorageConfigurationInput;
|
|
119
|
+
}
|
|
120
|
+
export interface PhoneNumberSettingsUpdateResponse {
|
|
121
|
+
readonly success?: boolean;
|
|
122
|
+
readonly [key: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
export interface BlockedUser {
|
|
125
|
+
readonly messaging_product?: string;
|
|
126
|
+
readonly wa_id?: string;
|
|
127
|
+
readonly [key: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
export interface BlockedUsersResponse {
|
|
130
|
+
readonly data?: readonly BlockedUser[];
|
|
131
|
+
readonly paging?: GraphPaging;
|
|
132
|
+
readonly [key: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
export interface BlockedUserOperation {
|
|
135
|
+
readonly input?: string;
|
|
136
|
+
readonly wa_id?: string;
|
|
137
|
+
readonly [key: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
export interface BlockUsersResponse {
|
|
140
|
+
readonly block_users?: {
|
|
141
|
+
readonly added_users?: readonly BlockedUserOperation[];
|
|
142
|
+
readonly [key: string]: unknown;
|
|
143
|
+
};
|
|
144
|
+
readonly messaging_product?: string;
|
|
145
|
+
readonly [key: string]: unknown;
|
|
146
|
+
}
|
|
147
|
+
export interface UnblockUsersResponse {
|
|
148
|
+
readonly block_users?: {
|
|
149
|
+
readonly removed_users?: readonly BlockedUserOperation[];
|
|
150
|
+
readonly [key: string]: unknown;
|
|
151
|
+
};
|
|
152
|
+
readonly messaging_product?: string;
|
|
153
|
+
readonly [key: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
export interface ListBlockedUsersInput {
|
|
156
|
+
readonly phoneNumberId: string;
|
|
157
|
+
}
|
|
158
|
+
export interface BlockUsersInput {
|
|
159
|
+
readonly phoneNumberId: string;
|
|
160
|
+
readonly users: readonly string[];
|
|
161
|
+
}
|
|
162
|
+
export interface UnblockUsersInput {
|
|
163
|
+
readonly phoneNumberId: string;
|
|
164
|
+
readonly users: readonly string[];
|
|
165
|
+
}
|
|
166
|
+
export interface OfficialBusinessAccountStatusResponse {
|
|
167
|
+
readonly id?: string;
|
|
168
|
+
readonly oba_status?: string;
|
|
169
|
+
readonly status_message?: string;
|
|
170
|
+
readonly [key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
export interface GetOfficialBusinessAccountStatusInput {
|
|
173
|
+
readonly phoneNumberId: string;
|
|
174
|
+
readonly fields?: BusinessManagementFields;
|
|
175
|
+
}
|
|
176
|
+
export interface RequestOfficialBusinessAccountReviewInput {
|
|
177
|
+
readonly phoneNumberId: string;
|
|
178
|
+
readonly businessWebsiteUrl: string;
|
|
179
|
+
readonly primaryCountryOfOperation: string;
|
|
180
|
+
readonly primaryLanguage?: string;
|
|
181
|
+
readonly parentBusinessOrBrand?: string;
|
|
182
|
+
readonly supportingLinks?: readonly string[];
|
|
183
|
+
readonly additionalSupportingInformation?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface OfficialBusinessAccountReviewResponse {
|
|
186
|
+
readonly success?: boolean;
|
|
187
|
+
readonly message?: string;
|
|
188
|
+
readonly updated_status?: OfficialBusinessAccountStatusResponse;
|
|
189
|
+
readonly tracking_id?: string;
|
|
190
|
+
readonly [key: string]: unknown;
|
|
191
|
+
}
|
|
192
|
+
export interface SubmitDisplayNameForReviewInput {
|
|
193
|
+
readonly phoneNumberId: string;
|
|
194
|
+
readonly newDisplayName: string;
|
|
195
|
+
}
|
|
196
|
+
export interface SubmitDisplayNameForReviewResponse {
|
|
197
|
+
readonly success?: boolean;
|
|
198
|
+
readonly [key: string]: unknown;
|
|
199
|
+
}
|
|
104
200
|
export interface GetBusinessProfileInput {
|
|
105
201
|
readonly phoneNumberId: string;
|
|
106
202
|
readonly fields?: BusinessManagementFields;
|
|
@@ -110,46 +206,94 @@ export interface GetCommerceSettingsInput {
|
|
|
110
206
|
readonly fields?: BusinessManagementFields;
|
|
111
207
|
}
|
|
112
208
|
type WireParams = Record<string, string>;
|
|
209
|
+
export declare function buildUpdatePhoneNumberSettingsBody(input: UpdatePhoneNumberSettingsInput): Record<string, unknown>;
|
|
210
|
+
export declare function normalizeUpdatePhoneNumberSettingsParams(input: UpdatePhoneNumberSettingsInput): WireParams;
|
|
113
211
|
export declare function normalizeWabaInfoParams(input: GetWabaInfoInput): WireParams;
|
|
114
212
|
export declare function normalizeListSubscribedAppsParams(input: ListSubscribedAppsInput): WireParams;
|
|
115
213
|
export declare function normalizeListPhoneNumbersParams(input: ListPhoneNumbersInput): WireParams;
|
|
116
214
|
export declare function normalizePhoneNumberInfoParams(input: GetPhoneNumberInfoInput): WireParams;
|
|
117
215
|
export declare function normalizePhoneNumberSettingsParams(input: GetPhoneNumberSettingsInput): WireParams;
|
|
216
|
+
export declare function normalizeListBlockedUsersParams(input: ListBlockedUsersInput): WireParams;
|
|
217
|
+
export declare function buildBlockUsersBody(input: BlockUsersInput | UnblockUsersInput): Record<string, unknown>;
|
|
218
|
+
export declare function normalizeBlockUsersParams(input: BlockUsersInput): WireParams;
|
|
219
|
+
export declare function buildUnblockUsersBody(input: UnblockUsersInput): Record<string, unknown>;
|
|
220
|
+
export declare function normalizeUnblockUsersParams(input: UnblockUsersInput): WireParams;
|
|
221
|
+
export declare function normalizeOfficialBusinessAccountStatusParams(input: GetOfficialBusinessAccountStatusInput): WireParams;
|
|
222
|
+
export declare function buildOfficialBusinessAccountReviewBody(input: RequestOfficialBusinessAccountReviewInput): Record<string, unknown>;
|
|
223
|
+
export declare function normalizeOfficialBusinessAccountReviewParams(input: RequestOfficialBusinessAccountReviewInput): WireParams;
|
|
224
|
+
export declare function buildDisplayNameReviewBody(input: SubmitDisplayNameForReviewInput): Record<string, unknown>;
|
|
225
|
+
export declare function normalizeDisplayNameReviewParams(input: SubmitDisplayNameForReviewInput): WireParams;
|
|
118
226
|
export declare function normalizeBusinessProfileParams(input: GetBusinessProfileInput): WireParams;
|
|
119
227
|
export declare function normalizeCommerceSettingsParams(input: GetCommerceSettingsInput): WireParams;
|
|
120
228
|
export declare function sanitizeBusinessManagementOptions(opts: EndpointInvokeOptions | undefined, helperName: string): EndpointInvokeOptions | undefined;
|
|
121
229
|
export declare const getWabaInfo: ((client: GraphClient, params: GetWabaInfoInput, body?: never, opts?: EndpointInvokeOptions) => Promise<WabaInfo>) & {
|
|
122
|
-
definition: import("
|
|
230
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
123
231
|
wabaId: string;
|
|
124
232
|
fields?: string;
|
|
125
233
|
}, never, WabaInfo>;
|
|
126
234
|
};
|
|
127
235
|
export declare const listSubscribedApps: ((client: GraphClient, params: ListSubscribedAppsInput, body?: never, opts?: EndpointInvokeOptions) => Promise<SubscribedAppsResponse>) & {
|
|
128
|
-
definition: import("
|
|
236
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
129
237
|
wabaId: string;
|
|
130
238
|
}, never, SubscribedAppsResponse>;
|
|
131
239
|
};
|
|
132
240
|
export declare const getPhoneNumberInfo: ((client: GraphClient, params: GetPhoneNumberInfoInput, body?: never, opts?: EndpointInvokeOptions) => Promise<PhoneNumberInfo>) & {
|
|
133
|
-
definition: import("
|
|
241
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
134
242
|
phoneNumberId: string;
|
|
135
243
|
fields?: string;
|
|
136
244
|
}, never, PhoneNumberInfo>;
|
|
137
245
|
};
|
|
138
246
|
export declare const getPhoneNumberSettings: ((client: GraphClient, params: GetPhoneNumberSettingsInput, body?: never, opts?: EndpointInvokeOptions) => Promise<PhoneNumberSettingsResponse>) & {
|
|
139
|
-
definition: import("
|
|
247
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
140
248
|
phoneNumberId: string;
|
|
141
249
|
fields?: string;
|
|
142
250
|
include_sip_credentials?: string;
|
|
143
251
|
}, never, PhoneNumberSettingsResponse>;
|
|
144
252
|
};
|
|
253
|
+
export declare const updatePhoneNumberSettings: ((client: GraphClient, params: UpdatePhoneNumberSettingsInput, body?: never, opts?: EndpointInvokeOptions) => Promise<PhoneNumberSettingsUpdateResponse>) & {
|
|
254
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
255
|
+
phoneNumberId: string;
|
|
256
|
+
}, UpdatePhoneNumberSettingsInput, PhoneNumberSettingsUpdateResponse>;
|
|
257
|
+
};
|
|
258
|
+
export declare const listBlockedUsers: ((client: GraphClient, params: ListBlockedUsersInput, body?: never, opts?: EndpointInvokeOptions) => Promise<BlockedUsersResponse>) & {
|
|
259
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
260
|
+
phoneNumberId: string;
|
|
261
|
+
}, never, BlockedUsersResponse>;
|
|
262
|
+
};
|
|
263
|
+
export declare const blockUsers: ((client: GraphClient, params: BlockUsersInput, body?: never, opts?: EndpointInvokeOptions) => Promise<BlockUsersResponse>) & {
|
|
264
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
265
|
+
phoneNumberId: string;
|
|
266
|
+
}, BlockUsersInput, BlockUsersResponse>;
|
|
267
|
+
};
|
|
268
|
+
export declare const unblockUsers: ((client: GraphClient, params: UnblockUsersInput, body?: never, opts?: EndpointInvokeOptions) => Promise<UnblockUsersResponse>) & {
|
|
269
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
270
|
+
phoneNumberId: string;
|
|
271
|
+
}, UnblockUsersInput, UnblockUsersResponse>;
|
|
272
|
+
};
|
|
273
|
+
export declare const getOfficialBusinessAccountStatus: ((client: GraphClient, params: GetOfficialBusinessAccountStatusInput, body?: never, opts?: EndpointInvokeOptions) => Promise<OfficialBusinessAccountStatusResponse>) & {
|
|
274
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
275
|
+
phoneNumberId: string;
|
|
276
|
+
fields?: string;
|
|
277
|
+
}, never, OfficialBusinessAccountStatusResponse>;
|
|
278
|
+
};
|
|
279
|
+
export declare const requestOfficialBusinessAccountReview: ((client: GraphClient, params: RequestOfficialBusinessAccountReviewInput, body?: never, opts?: EndpointInvokeOptions) => Promise<OfficialBusinessAccountReviewResponse>) & {
|
|
280
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
281
|
+
phoneNumberId: string;
|
|
282
|
+
}, RequestOfficialBusinessAccountReviewInput, OfficialBusinessAccountReviewResponse>;
|
|
283
|
+
};
|
|
284
|
+
export declare const submitDisplayNameForReview: ((client: GraphClient, params: SubmitDisplayNameForReviewInput, body?: never, opts?: EndpointInvokeOptions) => Promise<SubmitDisplayNameForReviewResponse>) & {
|
|
285
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
286
|
+
phoneNumberId: string;
|
|
287
|
+
}, SubmitDisplayNameForReviewInput, SubmitDisplayNameForReviewResponse>;
|
|
288
|
+
};
|
|
145
289
|
export declare const getBusinessProfile: ((client: GraphClient, params: GetBusinessProfileInput, body?: never, opts?: EndpointInvokeOptions) => Promise<BusinessProfileResponse>) & {
|
|
146
|
-
definition: import("
|
|
290
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
147
291
|
phoneNumberId: string;
|
|
148
292
|
fields?: string;
|
|
149
293
|
}, never, BusinessProfileResponse>;
|
|
150
294
|
};
|
|
151
295
|
export declare const getCommerceSettings: ((client: GraphClient, params: GetCommerceSettingsInput, body?: never, opts?: EndpointInvokeOptions) => Promise<CommerceSettingsResponse>) & {
|
|
152
|
-
definition: import("
|
|
296
|
+
definition: import("../endpoint.js").EndpointDefinition<{
|
|
153
297
|
phoneNumberId: string;
|
|
154
298
|
fields?: string;
|
|
155
299
|
}, never, CommerceSettingsResponse>;
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
import { defineEndpoint } from "../endpoint";
|
|
2
|
-
import { GraphRequestValidationError } from "../errors";
|
|
1
|
+
import { defineEndpoint } from "../endpoint.js";
|
|
2
|
+
import { GraphRequestValidationError } from "../errors.js";
|
|
3
3
|
import {
|
|
4
4
|
assertRepeatedlyDecodedSafePathId
|
|
5
|
-
} from "../internal/validation/paths";
|
|
5
|
+
} from "../internal/validation/paths.js";
|
|
6
6
|
import {
|
|
7
7
|
assertQueryString as assertInternalQueryString
|
|
8
|
-
} from "../internal/validation/strings";
|
|
9
|
-
import { assertJoinedStringQueryArray } from "../internal/validation/arrays";
|
|
10
|
-
import { sanitizeHeaderInit } from "../internal/validation/headers";
|
|
8
|
+
} from "../internal/validation/strings.js";
|
|
9
|
+
import { assertDenseDataArray, assertJoinedStringQueryArray } from "../internal/validation/arrays.js";
|
|
10
|
+
import { sanitizeHeaderInit } from "../internal/validation/headers.js";
|
|
11
11
|
import {
|
|
12
12
|
assertPlainDataRecord,
|
|
13
13
|
ownDataValue as ownInternalDataValue
|
|
14
|
-
} from "../internal/validation/records";
|
|
14
|
+
} from "../internal/validation/records.js";
|
|
15
15
|
const MAX_ID_LENGTH = 512;
|
|
16
16
|
const MAX_QUERY_STRING_LENGTH = 1024;
|
|
17
17
|
const MAX_FIELD_ARRAY_LENGTH = 50;
|
|
18
18
|
const MAX_FIELD_ITEM_LENGTH = 128;
|
|
19
19
|
const MAX_CURSOR_LENGTH = 512;
|
|
20
20
|
const MAX_PERCENT_DECODE_ROUNDS = 8;
|
|
21
|
+
const MAX_BLOCK_USERS = 50;
|
|
22
|
+
const MAX_RECIPIENT_DIGITS = 15;
|
|
23
|
+
const MAX_DISPLAY_NAME_LENGTH = 128;
|
|
24
|
+
const MAX_OBA_TEXT_LENGTH = 2048;
|
|
25
|
+
const MAX_OBA_URL_LENGTH = 2048;
|
|
26
|
+
const MAX_OBA_SUPPORTING_LINKS = 10;
|
|
27
|
+
const MIN_OBA_SUPPORTING_LINKS = 5;
|
|
21
28
|
function validationError(message, cause) {
|
|
22
29
|
return new GraphRequestValidationError(message, cause);
|
|
23
30
|
}
|
|
@@ -112,6 +119,119 @@ function optionalIncludeSipCredentials(record, helperName) {
|
|
|
112
119
|
}
|
|
113
120
|
return value ? "true" : "false";
|
|
114
121
|
}
|
|
122
|
+
function assertRecipient(value, fieldName, helperName) {
|
|
123
|
+
if (typeof value !== "string") {
|
|
124
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be a phone-number string.`);
|
|
125
|
+
}
|
|
126
|
+
if (value.length === 0 || value.trim().length === 0) {
|
|
127
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be a non-empty phone-number string.`);
|
|
128
|
+
}
|
|
129
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
130
|
+
const code = value.charCodeAt(index);
|
|
131
|
+
if (code < 32 || code === 127) {
|
|
132
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must not contain control characters.`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (value.includes("/") || value.includes("\\") || value.includes("?") || value.includes("#") || value.includes(":") || value.includes("@")) {
|
|
136
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be a phone-number string, not a path, URL, or address.`);
|
|
137
|
+
}
|
|
138
|
+
if (!/^\+?\d{1,15}$/u.test(value)) {
|
|
139
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be E.164-ish digits with optional leading + and at most ${MAX_RECIPIENT_DIGITS} digits.`);
|
|
140
|
+
}
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
function normalizeBlockUserList(value, helperName) {
|
|
144
|
+
const items = assertDenseDataArray(value, {
|
|
145
|
+
helperName,
|
|
146
|
+
path: "users",
|
|
147
|
+
minLength: 1,
|
|
148
|
+
maxLength: MAX_BLOCK_USERS,
|
|
149
|
+
invalidTypeMessage: `Invalid ${helperName} input: users must be an array of phone-number strings.`,
|
|
150
|
+
invalidLengthMessage: `Invalid ${helperName} input: users length must be between 1 and ${MAX_BLOCK_USERS}.`,
|
|
151
|
+
sparseArrayMessage: `Invalid ${helperName} input: users must not contain sparse array holes.`,
|
|
152
|
+
unsafePrototypeKeyMessage: `Invalid ${helperName} input: users contains an unsafe prototype key.`,
|
|
153
|
+
unsupportedPropertyMessage: `Invalid ${helperName} input: users contains unsupported properties.`
|
|
154
|
+
});
|
|
155
|
+
return items.map((item, index) => ({ user: assertRecipient(item, `users[${index}]`, helperName) }));
|
|
156
|
+
}
|
|
157
|
+
function assertBoundedPlainString(value, fieldName, helperName, maxLength) {
|
|
158
|
+
const out = assertQueryString(value, fieldName, helperName, maxLength);
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
function assertHttpUrl(value, fieldName, helperName) {
|
|
162
|
+
const raw = assertBoundedPlainString(value, fieldName, helperName, MAX_OBA_URL_LENGTH);
|
|
163
|
+
let parsed;
|
|
164
|
+
try {
|
|
165
|
+
parsed = new URL(raw);
|
|
166
|
+
} catch (error) {
|
|
167
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be an http(s) URL.`, error);
|
|
168
|
+
}
|
|
169
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
170
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be an http(s) URL.`);
|
|
171
|
+
}
|
|
172
|
+
return raw;
|
|
173
|
+
}
|
|
174
|
+
function optionalBoundedString(record, key, helperName) {
|
|
175
|
+
const value = ownDataValue(record, key, helperName, false);
|
|
176
|
+
if (value === undefined)
|
|
177
|
+
return;
|
|
178
|
+
return assertBoundedPlainString(value, key, helperName, MAX_OBA_TEXT_LENGTH);
|
|
179
|
+
}
|
|
180
|
+
function optionalSupportingLinks(record, helperName) {
|
|
181
|
+
const value = ownDataValue(record, "supportingLinks", helperName, false);
|
|
182
|
+
if (value === undefined)
|
|
183
|
+
return;
|
|
184
|
+
const items = assertDenseDataArray(value, {
|
|
185
|
+
helperName,
|
|
186
|
+
path: "supportingLinks",
|
|
187
|
+
minLength: MIN_OBA_SUPPORTING_LINKS,
|
|
188
|
+
maxLength: MAX_OBA_SUPPORTING_LINKS,
|
|
189
|
+
invalidTypeMessage: `Invalid ${helperName} input: supportingLinks must be an array of http(s) URLs.`,
|
|
190
|
+
invalidLengthMessage: `Invalid ${helperName} input: supportingLinks length must be between ${MIN_OBA_SUPPORTING_LINKS} and ${MAX_OBA_SUPPORTING_LINKS}.`,
|
|
191
|
+
sparseArrayMessage: `Invalid ${helperName} input: supportingLinks must not contain sparse array holes.`,
|
|
192
|
+
unsafePrototypeKeyMessage: `Invalid ${helperName} input: supportingLinks contains an unsafe prototype key.`,
|
|
193
|
+
unsupportedPropertyMessage: `Invalid ${helperName} input: supportingLinks contains unsupported properties.`
|
|
194
|
+
});
|
|
195
|
+
const out = items.map((item, index) => assertHttpUrl(item, `supportingLinks[${index}]`, helperName));
|
|
196
|
+
if (new Set(out).size !== out.length) {
|
|
197
|
+
throw validationError(`Invalid ${helperName} input: supportingLinks must not contain duplicates.`);
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
function sanitizeStorageConfiguration(value, helperName) {
|
|
202
|
+
const record = assertPlainRecord(value, helperName, "storageConfiguration");
|
|
203
|
+
const status = ownDataValue(record, "status", helperName, true);
|
|
204
|
+
const out = {
|
|
205
|
+
status: assertQueryString(status, "storageConfiguration.status", helperName, 32).toUpperCase()
|
|
206
|
+
};
|
|
207
|
+
for (const [key, nested] of Object.entries(record)) {
|
|
208
|
+
if (key === "status")
|
|
209
|
+
continue;
|
|
210
|
+
if (key === "dataLocalizationRegion" || key === "data_localization_region") {
|
|
211
|
+
throw validationError(`Invalid ${helperName} input: dataLocalizationRegion is not supported; use storageConfiguration.`);
|
|
212
|
+
}
|
|
213
|
+
if (nested !== undefined)
|
|
214
|
+
out[key] = nested;
|
|
215
|
+
}
|
|
216
|
+
return out;
|
|
217
|
+
}
|
|
218
|
+
export function buildUpdatePhoneNumberSettingsBody(input) {
|
|
219
|
+
const helperName = "updatePhoneNumberSettings";
|
|
220
|
+
const record = assertPlainRecord(input, "updatePhoneNumberSettings");
|
|
221
|
+
if (ownDataValue(record, "dataLocalizationRegion", "updatePhoneNumberSettings", false) !== undefined || ownDataValue(record, "data_localization_region", "updatePhoneNumberSettings", false) !== undefined) {
|
|
222
|
+
throw validationError("Invalid updatePhoneNumberSettings input: dataLocalizationRegion is not supported; use storageConfiguration.");
|
|
223
|
+
}
|
|
224
|
+
const storageConfiguration = ownDataValue(record, "storageConfiguration", "updatePhoneNumberSettings", false);
|
|
225
|
+
if (storageConfiguration === undefined) {
|
|
226
|
+
throw validationError("Invalid updatePhoneNumberSettings input: storageConfiguration is required.");
|
|
227
|
+
}
|
|
228
|
+
return { storage_configuration: sanitizeStorageConfiguration(storageConfiguration, "updatePhoneNumberSettings") };
|
|
229
|
+
}
|
|
230
|
+
export function normalizeUpdatePhoneNumberSettingsParams(input) {
|
|
231
|
+
const helperName = "updatePhoneNumberSettings";
|
|
232
|
+
const record = assertPlainRecord(input, "updatePhoneNumberSettings");
|
|
233
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "updatePhoneNumberSettings", true), "phoneNumberId", "updatePhoneNumberSettings") };
|
|
234
|
+
}
|
|
115
235
|
export function normalizeWabaInfoParams(input) {
|
|
116
236
|
const helperName = "getWabaInfo";
|
|
117
237
|
const record = assertPlainRecord(input, "getWabaInfo");
|
|
@@ -165,6 +285,85 @@ export function normalizePhoneNumberSettingsParams(input) {
|
|
|
165
285
|
out.include_sip_credentials = includeSipCredentials;
|
|
166
286
|
return out;
|
|
167
287
|
}
|
|
288
|
+
export function normalizeListBlockedUsersParams(input) {
|
|
289
|
+
const helperName = "listBlockedUsers";
|
|
290
|
+
const record = assertPlainRecord(input, "listBlockedUsers");
|
|
291
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "listBlockedUsers", true), "phoneNumberId", "listBlockedUsers") };
|
|
292
|
+
}
|
|
293
|
+
export function buildBlockUsersBody(input) {
|
|
294
|
+
const helperName = "blockUsers";
|
|
295
|
+
const record = assertPlainRecord(input, "blockUsers");
|
|
296
|
+
return {
|
|
297
|
+
messaging_product: "whatsapp",
|
|
298
|
+
block_users: normalizeBlockUserList(ownDataValue(record, "users", "blockUsers", true), "blockUsers")
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
export function normalizeBlockUsersParams(input) {
|
|
302
|
+
const helperName = "blockUsers";
|
|
303
|
+
const record = assertPlainRecord(input, "blockUsers");
|
|
304
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "blockUsers", true), "phoneNumberId", "blockUsers") };
|
|
305
|
+
}
|
|
306
|
+
export function buildUnblockUsersBody(input) {
|
|
307
|
+
const helperName = "unblockUsers";
|
|
308
|
+
const record = assertPlainRecord(input, "unblockUsers");
|
|
309
|
+
return {
|
|
310
|
+
messaging_product: "whatsapp",
|
|
311
|
+
block_users: normalizeBlockUserList(ownDataValue(record, "users", "unblockUsers", true), "unblockUsers")
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
export function normalizeUnblockUsersParams(input) {
|
|
315
|
+
const helperName = "unblockUsers";
|
|
316
|
+
const record = assertPlainRecord(input, "unblockUsers");
|
|
317
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "unblockUsers", true), "phoneNumberId", "unblockUsers") };
|
|
318
|
+
}
|
|
319
|
+
export function normalizeOfficialBusinessAccountStatusParams(input) {
|
|
320
|
+
const helperName = "getOfficialBusinessAccountStatus";
|
|
321
|
+
const record = assertPlainRecord(input, "getOfficialBusinessAccountStatus");
|
|
322
|
+
const out = { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "getOfficialBusinessAccountStatus", true), "phoneNumberId", "getOfficialBusinessAccountStatus") };
|
|
323
|
+
const fields = optionalFields(record, "getOfficialBusinessAccountStatus");
|
|
324
|
+
if (fields !== undefined)
|
|
325
|
+
out.fields = fields;
|
|
326
|
+
return out;
|
|
327
|
+
}
|
|
328
|
+
export function buildOfficialBusinessAccountReviewBody(input) {
|
|
329
|
+
const helperName = "requestOfficialBusinessAccountReview";
|
|
330
|
+
const record = assertPlainRecord(input, "requestOfficialBusinessAccountReview");
|
|
331
|
+
const out = {
|
|
332
|
+
business_website_url: assertHttpUrl(ownDataValue(record, "businessWebsiteUrl", "requestOfficialBusinessAccountReview", true), "businessWebsiteUrl", "requestOfficialBusinessAccountReview"),
|
|
333
|
+
primary_country_of_operation: assertBoundedPlainString(ownDataValue(record, "primaryCountryOfOperation", "requestOfficialBusinessAccountReview", true), "primaryCountryOfOperation", "requestOfficialBusinessAccountReview", 2).toUpperCase()
|
|
334
|
+
};
|
|
335
|
+
if (!/^[A-Z]{2}$/u.test(out.primary_country_of_operation)) {
|
|
336
|
+
throw validationError("Invalid requestOfficialBusinessAccountReview input: primaryCountryOfOperation must be an ISO 3166-1 alpha-2 country code.");
|
|
337
|
+
}
|
|
338
|
+
const primaryLanguage = optionalBoundedString(record, "primaryLanguage", "requestOfficialBusinessAccountReview");
|
|
339
|
+
const parentBusinessOrBrand = optionalBoundedString(record, "parentBusinessOrBrand", "requestOfficialBusinessAccountReview");
|
|
340
|
+
const supportingLinks = optionalSupportingLinks(record, "requestOfficialBusinessAccountReview");
|
|
341
|
+
const additional = optionalBoundedString(record, "additionalSupportingInformation", "requestOfficialBusinessAccountReview");
|
|
342
|
+
if (primaryLanguage !== undefined)
|
|
343
|
+
out.primary_language = primaryLanguage;
|
|
344
|
+
if (parentBusinessOrBrand !== undefined)
|
|
345
|
+
out.parent_business_or_brand = parentBusinessOrBrand;
|
|
346
|
+
if (supportingLinks !== undefined)
|
|
347
|
+
out.supporting_links = supportingLinks;
|
|
348
|
+
if (additional !== undefined)
|
|
349
|
+
out.additional_supporting_information = additional;
|
|
350
|
+
return out;
|
|
351
|
+
}
|
|
352
|
+
export function normalizeOfficialBusinessAccountReviewParams(input) {
|
|
353
|
+
const helperName = "requestOfficialBusinessAccountReview";
|
|
354
|
+
const record = assertPlainRecord(input, "requestOfficialBusinessAccountReview");
|
|
355
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "requestOfficialBusinessAccountReview", true), "phoneNumberId", "requestOfficialBusinessAccountReview") };
|
|
356
|
+
}
|
|
357
|
+
export function buildDisplayNameReviewBody(input) {
|
|
358
|
+
const helperName = "submitDisplayNameForReview";
|
|
359
|
+
const record = assertPlainRecord(input, "submitDisplayNameForReview");
|
|
360
|
+
return { new_display_name: assertBoundedPlainString(ownDataValue(record, "newDisplayName", "submitDisplayNameForReview", true), "newDisplayName", "submitDisplayNameForReview", MAX_DISPLAY_NAME_LENGTH) };
|
|
361
|
+
}
|
|
362
|
+
export function normalizeDisplayNameReviewParams(input) {
|
|
363
|
+
const helperName = "submitDisplayNameForReview";
|
|
364
|
+
const record = assertPlainRecord(input, "submitDisplayNameForReview");
|
|
365
|
+
return { phoneNumberId: assertPathId(ownDataValue(record, "phoneNumberId", "submitDisplayNameForReview", true), "phoneNumberId", "submitDisplayNameForReview") };
|
|
366
|
+
}
|
|
168
367
|
export function normalizeBusinessProfileParams(input) {
|
|
169
368
|
const helperName = "getBusinessProfile";
|
|
170
369
|
const record = assertPlainRecord(input, "getBusinessProfile");
|
|
@@ -241,6 +440,51 @@ const getPhoneNumberSettingsRaw = defineEndpoint({
|
|
|
241
440
|
include_sip_credentials: { in: "query" }
|
|
242
441
|
}
|
|
243
442
|
});
|
|
443
|
+
const listBlockedUsersRaw = defineEndpoint({
|
|
444
|
+
method: "GET",
|
|
445
|
+
pathTemplate: "/{phoneNumberId}/block_users",
|
|
446
|
+
params: { phoneNumberId: { in: "path", required: true } }
|
|
447
|
+
});
|
|
448
|
+
const blockUsersRaw = defineEndpoint({
|
|
449
|
+
method: "POST",
|
|
450
|
+
pathTemplate: "/{phoneNumberId}/block_users",
|
|
451
|
+
params: { phoneNumberId: { in: "path", required: true } },
|
|
452
|
+
bodyContentType: "application/json",
|
|
453
|
+
buildBody: buildBlockUsersBody
|
|
454
|
+
});
|
|
455
|
+
const unblockUsersRaw = defineEndpoint({
|
|
456
|
+
method: "DELETE",
|
|
457
|
+
pathTemplate: "/{phoneNumberId}/block_users",
|
|
458
|
+
params: { phoneNumberId: { in: "path", required: true } },
|
|
459
|
+
bodyContentType: "application/json",
|
|
460
|
+
buildBody: buildUnblockUsersBody
|
|
461
|
+
});
|
|
462
|
+
const getOfficialBusinessAccountStatusRaw = defineEndpoint({
|
|
463
|
+
method: "GET",
|
|
464
|
+
pathTemplate: "/{phoneNumberId}/official_business_account",
|
|
465
|
+
params: { phoneNumberId: { in: "path", required: true }, fields: { in: "query" } }
|
|
466
|
+
});
|
|
467
|
+
const requestOfficialBusinessAccountReviewRaw = defineEndpoint({
|
|
468
|
+
method: "POST",
|
|
469
|
+
pathTemplate: "/{phoneNumberId}/official_business_account",
|
|
470
|
+
params: { phoneNumberId: { in: "path", required: true } },
|
|
471
|
+
bodyContentType: "application/json",
|
|
472
|
+
buildBody: buildOfficialBusinessAccountReviewBody
|
|
473
|
+
});
|
|
474
|
+
const submitDisplayNameForReviewRaw = defineEndpoint({
|
|
475
|
+
method: "POST",
|
|
476
|
+
pathTemplate: "/{phoneNumberId}",
|
|
477
|
+
params: { phoneNumberId: { in: "path", required: true } },
|
|
478
|
+
bodyContentType: "application/json",
|
|
479
|
+
buildBody: buildDisplayNameReviewBody
|
|
480
|
+
});
|
|
481
|
+
const updatePhoneNumberSettingsRaw = defineEndpoint({
|
|
482
|
+
method: "POST",
|
|
483
|
+
pathTemplate: "/{phoneNumberId}/settings",
|
|
484
|
+
params: { phoneNumberId: { in: "path", required: true } },
|
|
485
|
+
bodyContentType: "application/json",
|
|
486
|
+
buildBody: buildUpdatePhoneNumberSettingsBody
|
|
487
|
+
});
|
|
244
488
|
const getBusinessProfileRaw = defineEndpoint({
|
|
245
489
|
method: "GET",
|
|
246
490
|
pathTemplate: "/{phoneNumberId}/whatsapp_business_profile",
|
|
@@ -267,6 +511,34 @@ export const getPhoneNumberSettings = Object.assign(async function getPhoneNumbe
|
|
|
267
511
|
assertNoBody(body, "getPhoneNumberSettings");
|
|
268
512
|
return getPhoneNumberSettingsRaw(client, normalizePhoneNumberSettingsParams(params), undefined, sanitizeBusinessManagementOptions(opts, "getPhoneNumberSettings"));
|
|
269
513
|
}, { definition: getPhoneNumberSettingsRaw.definition });
|
|
514
|
+
export const updatePhoneNumberSettings = Object.assign(async function updatePhoneNumberSettings(client, params, body, opts) {
|
|
515
|
+
assertNoBody(body, "updatePhoneNumberSettings");
|
|
516
|
+
return updatePhoneNumberSettingsRaw(client, normalizeUpdatePhoneNumberSettingsParams(params), params, sanitizeBusinessManagementOptions(opts, "updatePhoneNumberSettings"));
|
|
517
|
+
}, { definition: updatePhoneNumberSettingsRaw.definition });
|
|
518
|
+
export const listBlockedUsers = Object.assign(async function listBlockedUsers(client, params, body, opts) {
|
|
519
|
+
assertNoBody(body, "listBlockedUsers");
|
|
520
|
+
return listBlockedUsersRaw(client, normalizeListBlockedUsersParams(params), undefined, sanitizeBusinessManagementOptions(opts, "listBlockedUsers"));
|
|
521
|
+
}, { definition: listBlockedUsersRaw.definition });
|
|
522
|
+
export const blockUsers = Object.assign(async function blockUsers(client, params, body, opts) {
|
|
523
|
+
assertNoBody(body, "blockUsers");
|
|
524
|
+
return blockUsersRaw(client, normalizeBlockUsersParams(params), params, sanitizeBusinessManagementOptions(opts, "blockUsers"));
|
|
525
|
+
}, { definition: blockUsersRaw.definition });
|
|
526
|
+
export const unblockUsers = Object.assign(async function unblockUsers(client, params, body, opts) {
|
|
527
|
+
assertNoBody(body, "unblockUsers");
|
|
528
|
+
return unblockUsersRaw(client, normalizeUnblockUsersParams(params), params, sanitizeBusinessManagementOptions(opts, "unblockUsers"));
|
|
529
|
+
}, { definition: unblockUsersRaw.definition });
|
|
530
|
+
export const getOfficialBusinessAccountStatus = Object.assign(async function getOfficialBusinessAccountStatus(client, params, body, opts) {
|
|
531
|
+
assertNoBody(body, "getOfficialBusinessAccountStatus");
|
|
532
|
+
return getOfficialBusinessAccountStatusRaw(client, normalizeOfficialBusinessAccountStatusParams(params), undefined, sanitizeBusinessManagementOptions(opts, "getOfficialBusinessAccountStatus"));
|
|
533
|
+
}, { definition: getOfficialBusinessAccountStatusRaw.definition });
|
|
534
|
+
export const requestOfficialBusinessAccountReview = Object.assign(async function requestOfficialBusinessAccountReview(client, params, body, opts) {
|
|
535
|
+
assertNoBody(body, "requestOfficialBusinessAccountReview");
|
|
536
|
+
return requestOfficialBusinessAccountReviewRaw(client, normalizeOfficialBusinessAccountReviewParams(params), params, sanitizeBusinessManagementOptions(opts, "requestOfficialBusinessAccountReview"));
|
|
537
|
+
}, { definition: requestOfficialBusinessAccountReviewRaw.definition });
|
|
538
|
+
export const submitDisplayNameForReview = Object.assign(async function submitDisplayNameForReview(client, params, body, opts) {
|
|
539
|
+
assertNoBody(body, "submitDisplayNameForReview");
|
|
540
|
+
return submitDisplayNameForReviewRaw(client, normalizeDisplayNameReviewParams(params), params, sanitizeBusinessManagementOptions(opts, "submitDisplayNameForReview"));
|
|
541
|
+
}, { definition: submitDisplayNameForReviewRaw.definition });
|
|
270
542
|
export const getBusinessProfile = Object.assign(async function getBusinessProfile(client, params, body, opts) {
|
|
271
543
|
assertNoBody(body, "getBusinessProfile");
|
|
272
544
|
return getBusinessProfileRaw(client, normalizeBusinessProfileParams(params), undefined, sanitizeBusinessManagementOptions(opts, "getBusinessProfile"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EndpointInvokeOptions } from "../endpoint";
|
|
2
|
-
import type { GraphClient } from "../client";
|
|
1
|
+
import { type EndpointInvokeOptions } from "../endpoint.js";
|
|
2
|
+
import type { GraphClient } from "../client.js";
|
|
3
3
|
export type CallAction = "connect" | "pre_accept" | "accept" | "reject" | "terminate";
|
|
4
4
|
export type CallSdpType = "offer" | "answer" | string;
|
|
5
5
|
export declare const CALL_BIZ_OPAQUE_CALLBACK_DATA_MAX_LENGTH = 512;
|
|
@@ -48,18 +48,18 @@ type CallsParams = {
|
|
|
48
48
|
type WireBody = Record<string, unknown>;
|
|
49
49
|
export declare function sanitizeCallSession(input: unknown): CallSessionDescriptionPayload;
|
|
50
50
|
export declare const initiateCall: ((client: GraphClient, params: CallsParams, body: InitiateCallRequest, opts?: EndpointInvokeOptions) => Promise<CallLifecycleResponse>) & {
|
|
51
|
-
definition: import("
|
|
51
|
+
definition: import("../endpoint.js").EndpointDefinition<CallsParams, WireBody, CallLifecycleResponse>;
|
|
52
52
|
};
|
|
53
53
|
export declare const preAcceptCall: ((client: GraphClient, params: CallsParams, body: PreAcceptCallRequest, opts?: EndpointInvokeOptions) => Promise<CallLifecycleResponse>) & {
|
|
54
|
-
definition: import("
|
|
54
|
+
definition: import("../endpoint.js").EndpointDefinition<CallsParams, WireBody, CallLifecycleResponse>;
|
|
55
55
|
};
|
|
56
56
|
export declare const acceptCall: ((client: GraphClient, params: CallsParams, body: AcceptCallRequest, opts?: EndpointInvokeOptions) => Promise<CallLifecycleResponse>) & {
|
|
57
|
-
definition: import("
|
|
57
|
+
definition: import("../endpoint.js").EndpointDefinition<CallsParams, WireBody, CallLifecycleResponse>;
|
|
58
58
|
};
|
|
59
59
|
export declare const rejectCall: ((client: GraphClient, params: CallsParams, body: RejectCallRequest, opts?: EndpointInvokeOptions) => Promise<CallLifecycleResponse>) & {
|
|
60
|
-
definition: import("
|
|
60
|
+
definition: import("../endpoint.js").EndpointDefinition<CallsParams, WireBody, CallLifecycleResponse>;
|
|
61
61
|
};
|
|
62
62
|
export declare const terminateCall: ((client: GraphClient, params: CallsParams, body: TerminateCallRequest, opts?: EndpointInvokeOptions) => Promise<CallLifecycleResponse>) & {
|
|
63
|
-
definition: import("
|
|
63
|
+
definition: import("../endpoint.js").EndpointDefinition<CallsParams, WireBody, CallLifecycleResponse>;
|
|
64
64
|
};
|
|
65
65
|
export {};
|