Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(sdk-js): export the list query types and encodeSegment
Yudhi Armyndharis0827de89231d
diff --git a/sdk/javascript/src/index.ts b/sdk/javascript/src/index.tsindex 714cebc16..b9ff1a385 100644--- a/sdk/javascript/src/index.ts+++ b/sdk/javascript/src/index.ts@@ -31,5 +31,10 @@ export type { OpenWAClientOptions } from './client.js';export * from './errors.js';export type * from './types.js';export type { BinaryResponse, ClientConfig, FetchLike, HttpMethod, RequestOptions } from './http.js';-export { buildUrl, warnIfInsecureHttpUrl } from './http.js';+export { buildUrl, encodeSegment, warnIfInsecureHttpUrl } from './http.js';+export type { ListChatsQuery } from './resources/chats.js';+export type { ListContactsQuery } from './resources/contacts.js';+export type { ListGroupsQuery } from './resources/groups.js';+export type { ListSessionsQuery } from './resources/sessions.js';+export type { DeliveryFailureQuery, WebhookListQuery } from './resources/webhooks.js';export { verifyWebhookSignature } from './webhook.js';diff --git a/sdk/javascript/test/entry-exports.test-d.ts b/sdk/javascript/test/entry-exports.test-d.tsnew file mode 100644index 000000000..501cdf224--- /dev/null+++ b/sdk/javascript/test/entry-exports.test-d.ts@@ -0,0 +1,27 @@+/**+ * Type-level check that the package entry point exposes what a consumer needs to type the public+ * resource methods; `tsc` is the gate (see `wire-contract.test-d.ts`). The `exports` map allows no+ * deep imports, so a query type declared in a resource file is unreachable unless `index.ts`+ * re-exports it.+ * @packageDocumentation+ */++import {+ encodeSegment,+ type DeliveryFailureQuery,+ type ListChatsQuery,+ type ListContactsQuery,+ type ListGroupsQuery,+ type ListSessionsQuery,+ type WebhookListQuery,+} from '../src/index.js';++const sessions: ListSessionsQuery = { name: 'my-session' };+const chats: ListChatsQuery = {};+const contacts: ListContactsQuery = {};+const groups: ListGroupsQuery = {};+const webhooks: WebhookListQuery = {};+const failures: DeliveryFailureQuery = {};+const segment: string = encodeSegment('[email protected]');++export const entryExports = [sessions, chats, contacts, groups, webhooks, failures, segment];