@wats/graph 0.3.30 → 0.5.0-beta
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/endpoints/flows/types.d.ts +2 -2
- package/dist/endpoints/media.d.ts +0 -11
- package/dist/endpoints/media.js +0 -17
- package/dist/endpoints/templates/advanced.d.ts +2 -2
- package/dist/errors.js +3 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -6
- package/dist/rateLimiter.d.ts +9 -2
- package/dist/rateLimiter.js +36 -2
- package/dist/reliableTransport.d.ts +17 -6
- package/dist/reliableTransport.js +26 -2
- package/dist/subclients/wabaClient.d.ts +6 -6
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ import { GraphClient, createFetchTransport, sendMessage } from "@wats/graph";
|
|
|
16
16
|
|
|
17
17
|
const graph = new GraphClient({
|
|
18
18
|
accessToken: process.env.WATS_ACCESS_TOKEN ?? "",
|
|
19
|
-
apiVersion: "
|
|
19
|
+
apiVersion: "v27.0",
|
|
20
20
|
transport: createFetchTransport()
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -78,8 +78,8 @@ export interface GetFlowAssetsInput {
|
|
|
78
78
|
* Canonical Flow metric names mirrored from pywa's `FlowMetricName` enum.
|
|
79
79
|
* Unknown values are preserved as raw strings (see {@link FlowMetric.name}).
|
|
80
80
|
*
|
|
81
|
-
* Reference:
|
|
82
|
-
* deprecated 2026-04-30; whether a replacement exists is
|
|
81
|
+
* Reference: Meta Flow Metrics API docs. The Metrics API is documented as
|
|
82
|
+
* deprecated 2026-04-30; whether a replacement exists is unverified.
|
|
83
83
|
*/
|
|
84
84
|
export declare const KNOWN_FLOW_METRIC_NAMES: readonly ["ENDPOINT_REQUEST_COUNT", "ENDPOINT_REQUEST_ERROR", "ENDPOINT_REQUEST_ERROR_RATE", "ENDPOINT_REQUEST_LATENCY_SECONDS_CEIL", "ENDPOINT_AVAILABILITY"];
|
|
85
85
|
export type FlowMetricName = (typeof KNOWN_FLOW_METRIC_NAMES)[number];
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { GraphClient } from "../client.js";
|
|
2
2
|
export type MediaOperation = "upload" | "download" | "delete" | "download_bytes" | "decrypt_encrypted" | "create_upload_session" | "upload_file_to_session" | "get_upload_session";
|
|
3
|
-
export type MediaNotImplementedCode = "not_implemented";
|
|
4
|
-
export declare class MediaNotImplementedError extends Error {
|
|
5
|
-
readonly code: MediaNotImplementedCode;
|
|
6
|
-
readonly operation: MediaOperation;
|
|
7
|
-
readonly linearIssue: string;
|
|
8
|
-
constructor(operation: MediaOperation, linearIssue: string);
|
|
9
|
-
}
|
|
10
3
|
export type MediaValidationErrorCode = "invalid_client" | "invalid_params" | "invalid_options" | "invalid_url" | "invalid_phone_number_id" | "invalid_media_id" | "invalid_app_id" | "invalid_upload_session_id" | "invalid_upload_body" | "invalid_file" | "invalid_file_name" | "invalid_file_length" | "invalid_media_type" | "invalid_file_type" | "unsupported_media_type" | "invalid_messaging_product" | "upload_too_large" | "download_too_large" | "invalid_file_offset" | "invalid_content_length" | "invalid_response";
|
|
11
4
|
export declare class MediaValidationError extends Error {
|
|
12
5
|
readonly code: MediaValidationErrorCode;
|
|
@@ -107,10 +100,6 @@ export interface GetUploadSessionResponse {
|
|
|
107
100
|
readonly id: string;
|
|
108
101
|
readonly fileOffset: number;
|
|
109
102
|
}
|
|
110
|
-
export declare const MEDIA_LINEAR_ISSUE_UPLOAD = "WATS-37";
|
|
111
|
-
export declare const MEDIA_LINEAR_ISSUE_DOWNLOAD = "WATS-37";
|
|
112
|
-
export declare const MEDIA_LINEAR_ISSUE_DELETE = "WATS-37";
|
|
113
|
-
export declare const MEDIA_LINEAR_ISSUE_DECRYPT = "WATS-37";
|
|
114
103
|
export declare function uploadMedia(client: GraphClient, params: {
|
|
115
104
|
phoneNumberId: string;
|
|
116
105
|
}, body: MediaUploadBody, options?: MediaUploadOptions): Promise<MediaUploadResponse>;
|
package/dist/endpoints/media.js
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { createGraphApiError } from "../errors.js";
|
|
2
2
|
|
|
3
|
-
export class MediaNotImplementedError extends Error {
|
|
4
|
-
code;
|
|
5
|
-
operation;
|
|
6
|
-
linearIssue;
|
|
7
|
-
constructor(operation, linearIssue) {
|
|
8
|
-
super(`Media ${operation} is not implemented. Track implementation via Linear issue ${linearIssue}.`);
|
|
9
|
-
this.name = "MediaNotImplementedError";
|
|
10
|
-
this.code = "not_implemented";
|
|
11
|
-
this.operation = operation;
|
|
12
|
-
this.linearIssue = linearIssue;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
3
|
export class MediaValidationError extends Error {
|
|
17
4
|
code;
|
|
18
5
|
constructor(code, message, cause) {
|
|
@@ -65,10 +52,6 @@ const TYPED_ARRAY_PROTOTYPE = Object.getPrototypeOf(Uint8Array.prototype);
|
|
|
65
52
|
const TYPED_ARRAY_BUFFER_GETTER = Object.getOwnPropertyDescriptor(TYPED_ARRAY_PROTOTYPE, "buffer")?.get;
|
|
66
53
|
const TYPED_ARRAY_BYTE_LENGTH_GETTER = Object.getOwnPropertyDescriptor(TYPED_ARRAY_PROTOTYPE, "byteLength")?.get;
|
|
67
54
|
const TYPED_ARRAY_BYTE_OFFSET_GETTER = Object.getOwnPropertyDescriptor(TYPED_ARRAY_PROTOTYPE, "byteOffset")?.get;
|
|
68
|
-
export const MEDIA_LINEAR_ISSUE_UPLOAD = "WATS-37";
|
|
69
|
-
export const MEDIA_LINEAR_ISSUE_DOWNLOAD = "WATS-37";
|
|
70
|
-
export const MEDIA_LINEAR_ISSUE_DELETE = "WATS-37";
|
|
71
|
-
export const MEDIA_LINEAR_ISSUE_DECRYPT = "WATS-37";
|
|
72
55
|
const MAX_PATH_DECODE_ROUNDS = 5;
|
|
73
56
|
const SAFE_ID_REGEXP = /^[A-Za-z0-9_-]+$/;
|
|
74
57
|
const PHONE_NUMBER_ID_REGEXP = /^\d+$/;
|
|
@@ -171,7 +171,7 @@ export interface UnarchiveTemplatesResponse {
|
|
|
171
171
|
* {@link ARCHIVE_TEMPLATES_MAX_IDS} message templates on a WABA. Mirrors
|
|
172
172
|
* pywa's `WhatsApp.archive_templates`. Uses `GraphClient.requestRaw` (not
|
|
173
173
|
* `defineEndpoint`) because the endpoint lives on api.facebook.com, not
|
|
174
|
-
* graph.facebook.com. See
|
|
174
|
+
* graph.facebook.com. See maintainers/template-management-reference.md §5.
|
|
175
175
|
*/
|
|
176
176
|
export declare function archiveTemplates(client: GraphClient, params: ArchiveTemplatesInput, _body?: never, opts?: EndpointInvokeOptions): Promise<ArchiveTemplatesResponse>;
|
|
177
177
|
/**
|
|
@@ -180,7 +180,7 @@ export declare function archiveTemplates(client: GraphClient, params: ArchiveTem
|
|
|
180
180
|
* {@link ARCHIVE_TEMPLATES_MAX_IDS} message templates on a WABA. Mirrors
|
|
181
181
|
* pywa's `WhatsApp.unarchive_templates`. Uses `GraphClient.requestRaw` (not
|
|
182
182
|
* `defineEndpoint`) because the endpoint lives on api.facebook.com, not
|
|
183
|
-
* graph.facebook.com. See
|
|
183
|
+
* graph.facebook.com. See maintainers/template-management-reference.md §5.
|
|
184
184
|
*/
|
|
185
185
|
export declare function unarchiveTemplates(client: GraphClient, params: UnarchiveTemplatesInput, _body?: never, opts?: EndpointInvokeOptions): Promise<UnarchiveTemplatesResponse>;
|
|
186
186
|
/** Finite cap on the number of languages per upsert call (defensive bound). */
|
package/dist/errors.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isRecord } from "@wats/internal-utils";
|
|
2
|
+
|
|
1
3
|
export class GraphApiError extends Error {
|
|
2
4
|
status;
|
|
3
5
|
type;
|
|
@@ -112,9 +114,6 @@ export class GraphSerializationError extends GraphApiError {
|
|
|
112
114
|
this.cause = cause;
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
|
-
function isRecord(value) {
|
|
116
|
-
return typeof value === "object" && value !== null;
|
|
117
|
-
}
|
|
118
117
|
export function isGraphApiErrorPayload(value) {
|
|
119
118
|
if (!isRecord(value) || Array.isArray(value)) {
|
|
120
119
|
return false;
|
|
@@ -178,7 +177,7 @@ function isRateLimitClassification(status, payload) {
|
|
|
178
177
|
}
|
|
179
178
|
return false;
|
|
180
179
|
}
|
|
181
|
-
const BEARER_TOKEN_REGEXP = /
|
|
180
|
+
const BEARER_TOKEN_REGEXP = /Bearer\s+\S+/g;
|
|
182
181
|
function redactString(value) {
|
|
183
182
|
return value.replace(BEARER_TOKEN_REGEXP, "Bearer ***");
|
|
184
183
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,5 +22,5 @@ export { createFetchTransport } from "./createFetchTransport.js";
|
|
|
22
22
|
export type { CreateFetchTransportOptions } from "./createFetchTransport.js";
|
|
23
23
|
export { paginate, paginateAll, PaginationError } from "./pagination.js";
|
|
24
24
|
export type { PaginationOptions, PaginatedResult, PaginatedPage, PaginationErrorCode } from "./pagination.js";
|
|
25
|
-
export { uploadMedia, downloadMedia, deleteMedia, downloadMediaBytes, decryptEncryptedMedia, createUploadSession, uploadFileToSession, getUploadSession,
|
|
26
|
-
export type { MediaOperation,
|
|
25
|
+
export { uploadMedia, downloadMedia, deleteMedia, downloadMediaBytes, decryptEncryptedMedia, createUploadSession, uploadFileToSession, getUploadSession, MediaValidationError, MediaCryptoError, MediaIntegrityError, DEFAULT_MAX_MEDIA_UPLOAD_BYTES, MAX_MEDIA_UPLOAD_BYTES, DEFAULT_MAX_MEDIA_DOWNLOAD_BYTES, MAX_MEDIA_DOWNLOAD_BYTES, DEFAULT_MAX_UPLOAD_SESSION_BYTES, MAX_UPLOAD_SESSION_BYTES } from "./endpoints/media.js";
|
|
26
|
+
export type { MediaOperation, MediaValidationErrorCode, MediaCryptoErrorCode, MediaIntegrityErrorCode, MediaUploadBody, MediaUploadOptions, MediaUploadResponse, MediaDownloadOptions, MediaDownloadResponse, MediaDeleteOptions, MediaDeleteResponse, MediaDownloadBytesOptions, MediaDownloadBytesResponse, EncryptedMediaBundle, CreateUploadSessionParams, UploadSessionOptions, CreateUploadSessionResponse, UploadFileToSessionParams, UploadFileToSessionResponse, GetUploadSessionParams, GetUploadSessionResponse } from "./endpoints/media.js";
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,6 @@ export {
|
|
|
39
39
|
createUploadSession,
|
|
40
40
|
uploadFileToSession,
|
|
41
41
|
getUploadSession,
|
|
42
|
-
MediaNotImplementedError,
|
|
43
42
|
MediaValidationError,
|
|
44
43
|
MediaCryptoError,
|
|
45
44
|
MediaIntegrityError,
|
|
@@ -48,9 +47,5 @@ export {
|
|
|
48
47
|
DEFAULT_MAX_MEDIA_DOWNLOAD_BYTES,
|
|
49
48
|
MAX_MEDIA_DOWNLOAD_BYTES,
|
|
50
49
|
DEFAULT_MAX_UPLOAD_SESSION_BYTES,
|
|
51
|
-
MAX_UPLOAD_SESSION_BYTES
|
|
52
|
-
MEDIA_LINEAR_ISSUE_UPLOAD,
|
|
53
|
-
MEDIA_LINEAR_ISSUE_DOWNLOAD,
|
|
54
|
-
MEDIA_LINEAR_ISSUE_DELETE,
|
|
55
|
-
MEDIA_LINEAR_ISSUE_DECRYPT
|
|
50
|
+
MAX_UPLOAD_SESSION_BYTES
|
|
56
51
|
} from "./endpoints/media.js";
|
package/dist/rateLimiter.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export interface RateLimiter {
|
|
2
2
|
/**
|
|
3
3
|
* Wait until `cost` tokens are available, then deduct them. Resolves once
|
|
4
|
-
* the request is admitted; never rejects unless the injected sleep does
|
|
4
|
+
* the request is admitted; never rejects unless the injected sleep does,
|
|
5
|
+
* or an `AbortSignal` is provided and aborts before admission.
|
|
6
|
+
*
|
|
7
|
+
* The optional `signal` is backwards compatible: callers using the legacy
|
|
8
|
+
* `acquire(cost?)` signature are unaffected. A real `AbortSignal` racing
|
|
9
|
+
* the wait rejects promptly with the signal's reason and consumes no
|
|
10
|
+
* token. Non-AbortSignal inputs fail closed with a TypeError rather than
|
|
11
|
+
* silently dropping cancellation.
|
|
5
12
|
*/
|
|
6
|
-
acquire(cost?: number): Promise<void>;
|
|
13
|
+
acquire(cost?: number, signal?: AbortSignal): Promise<void>;
|
|
7
14
|
/**
|
|
8
15
|
* Non-blocking admission check. Refills the bucket to the current virtual
|
|
9
16
|
* time, then if `cost` tokens are available deducts them and returns true;
|
package/dist/rateLimiter.js
CHANGED
|
@@ -27,6 +27,7 @@ export function createTokenBucketRateLimiter(options) {
|
|
|
27
27
|
throw new Error("CreateTokenBucketRateLimiterOptions: sleep must be a function.");
|
|
28
28
|
}
|
|
29
29
|
const now = options.now ?? (() => Date.now());
|
|
30
|
+
const usesDefaultSleep = options.sleep === undefined;
|
|
30
31
|
const sleep = options.sleep ?? defaultSleep;
|
|
31
32
|
let tokens = capacity;
|
|
32
33
|
let lastRefillMs = now();
|
|
@@ -49,9 +50,20 @@ export function createTokenBucketRateLimiter(options) {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
return {
|
|
52
|
-
async acquire(cost) {
|
|
53
|
+
async acquire(cost, signal) {
|
|
53
54
|
const c = assertCost(cost);
|
|
55
|
+
if (signal !== undefined) {
|
|
56
|
+
if (signal === null || !(signal instanceof AbortSignal)) {
|
|
57
|
+
throw new TypeError("RateLimiter.acquire: signal must be an AbortSignal or undefined.");
|
|
58
|
+
}
|
|
59
|
+
if (signal.aborted) {
|
|
60
|
+
throw signal.reason instanceof Error ? signal.reason : new Error("RateLimiter acquire aborted by caller.");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
54
63
|
for (;; ) {
|
|
64
|
+
if (signal?.aborted) {
|
|
65
|
+
throw signal.reason instanceof Error ? signal.reason : new Error("RateLimiter acquire aborted by caller.");
|
|
66
|
+
}
|
|
55
67
|
refill();
|
|
56
68
|
if (tokens >= c) {
|
|
57
69
|
tokens -= c;
|
|
@@ -59,7 +71,29 @@ export function createTokenBucketRateLimiter(options) {
|
|
|
59
71
|
}
|
|
60
72
|
const deficit = c - tokens;
|
|
61
73
|
const waitMs = deficit / refillPerSecond * 1000;
|
|
62
|
-
|
|
74
|
+
if (signal === undefined) {
|
|
75
|
+
await sleep(Math.max(0, waitMs));
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
let onAbort;
|
|
79
|
+
let timer;
|
|
80
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
81
|
+
onAbort = () => {
|
|
82
|
+
reject(signal.reason instanceof Error ? signal.reason : new Error("RateLimiter acquire aborted by caller."));
|
|
83
|
+
};
|
|
84
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
85
|
+
});
|
|
86
|
+
try {
|
|
87
|
+
const waiting = usesDefaultSleep ? new Promise((resolve) => {
|
|
88
|
+
timer = setTimeout(resolve, Math.max(0, waitMs));
|
|
89
|
+
}) : sleep(Math.max(0, waitMs));
|
|
90
|
+
await Promise.race([waiting, aborted]);
|
|
91
|
+
} finally {
|
|
92
|
+
if (timer !== undefined)
|
|
93
|
+
clearTimeout(timer);
|
|
94
|
+
if (onAbort !== undefined)
|
|
95
|
+
signal.removeEventListener("abort", onAbort);
|
|
96
|
+
}
|
|
63
97
|
}
|
|
64
98
|
},
|
|
65
99
|
tryAcquire(cost) {
|
|
@@ -20,16 +20,27 @@ export interface ReliableTransportOptions extends Partial<TransportRetryPolicy>
|
|
|
20
20
|
* the historical behavior: POST is retried only on 429 (the rate-limit
|
|
21
21
|
* exception), never on 5xx or network errors.
|
|
22
22
|
*
|
|
23
|
+
* A no-response POST failure (connection reset, socket closed mid-upload,
|
|
24
|
+
* read timeout) is ambiguous: the server may have received and applied the
|
|
25
|
+
* request before the response was lost. An Idempotency-Key header on its
|
|
26
|
+
* own proves nothing — the client sets it, the server has no obligation to
|
|
27
|
+
* honor it unless the endpoint documents verified remote idempotency. The
|
|
28
|
+
* retry modes below opt into retry only when you have independently verified
|
|
29
|
+
* the endpoint is idempotent or dedupes by Idempotency-Key server-side. The
|
|
30
|
+
* key is a necessary, not sufficient, condition; it never overrides the
|
|
31
|
+
* default "never".
|
|
32
|
+
*
|
|
23
33
|
* - "network-only": additionally retry a POST whose request threw a
|
|
24
34
|
* GraphNetworkError BEFORE any response arrived, but only when the request
|
|
25
|
-
* carries an Idempotency-Key header (case-insensitive).
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* POST 5xx is
|
|
35
|
+
* carries an Idempotency-Key header (case-insensitive). This is the least
|
|
36
|
+
* ambiguous POST failure shape, but still not exactly-once: the server may
|
|
37
|
+
* have applied the first send and lost the response. The retry is safe only
|
|
38
|
+
* if the endpoint dedupes by the key you supplied. POST 5xx is not retried —
|
|
39
|
+
* the server began processing and may have side-effected.
|
|
29
40
|
* - "always": additionally retry POST on 5xx. Requires server-side
|
|
30
41
|
* idempotency for the endpoint; a 5xx after the server began processing
|
|
31
|
-
* can otherwise duplicate a send. Use only for endpoints you have
|
|
32
|
-
*
|
|
42
|
+
* can otherwise duplicate a send. Use only for endpoints you have verified
|
|
43
|
+
* are idempotent or dedupe by Idempotency-Key.
|
|
33
44
|
*/
|
|
34
45
|
readonly retryPosts?: RetryPostMode;
|
|
35
46
|
readonly rateLimiter?: RateLimiter;
|
|
@@ -38,7 +38,7 @@ function resolvePolicy(options) {
|
|
|
38
38
|
if (options?.rateLimiter !== undefined) {
|
|
39
39
|
const rl = options.rateLimiter;
|
|
40
40
|
if (rl === null || typeof rl !== "object" || typeof rl.acquire !== "function") {
|
|
41
|
-
throw new Error("ReliableTransportOptions: rateLimiter must be an object with an acquire(cost?) => Promise<void> method.");
|
|
41
|
+
throw new Error("ReliableTransportOptions: rateLimiter must be an object with an acquire(cost?, signal?) => Promise<void> method.");
|
|
42
42
|
}
|
|
43
43
|
if (typeof rl.tryAcquire !== "function") {
|
|
44
44
|
throw new Error("ReliableTransportOptions: rateLimiter must also implement tryAcquire(cost?) => boolean.");
|
|
@@ -170,6 +170,25 @@ async function sleepWithAbort(sleep, delayMs, signal) {
|
|
|
170
170
|
signal.removeEventListener("abort", onAbort);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
async function acquireWithAbort(limiter, signal) {
|
|
174
|
+
let onAbort;
|
|
175
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
176
|
+
onAbort = () => {
|
|
177
|
+
reject(signal.reason instanceof Error ? signal.reason : new GraphNetworkError("Transport request aborted by caller."));
|
|
178
|
+
};
|
|
179
|
+
if (signal.aborted) {
|
|
180
|
+
onAbort();
|
|
181
|
+
} else {
|
|
182
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
try {
|
|
186
|
+
await Promise.race([limiter.acquire(undefined, signal), aborted]);
|
|
187
|
+
} finally {
|
|
188
|
+
if (onAbort !== undefined)
|
|
189
|
+
signal.removeEventListener("abort", onAbort);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
173
192
|
export function createReliableTransport(inner, options) {
|
|
174
193
|
if (inner === null || typeof inner !== "object" || typeof inner.request !== "function") {
|
|
175
194
|
throw new Error("ReliableTransportOptions: inner transport must implement request().");
|
|
@@ -182,8 +201,13 @@ export function createReliableTransport(inner, options) {
|
|
|
182
201
|
for (;; ) {
|
|
183
202
|
throwIfAborted(opts?.signal);
|
|
184
203
|
if (policy.rateLimiter !== undefined) {
|
|
185
|
-
|
|
204
|
+
if (opts?.signal !== undefined) {
|
|
205
|
+
await acquireWithAbort(policy.rateLimiter, opts.signal);
|
|
206
|
+
} else {
|
|
207
|
+
await policy.rateLimiter.acquire();
|
|
208
|
+
}
|
|
186
209
|
}
|
|
210
|
+
throwIfAborted(opts?.signal);
|
|
187
211
|
attempt += 1;
|
|
188
212
|
const composedSignal = composeSignal(opts?.signal, policy.timeoutMs);
|
|
189
213
|
const attemptOpts = composedSignal !== undefined ? { signal: composedSignal } : undefined;
|
|
@@ -73,7 +73,7 @@ export declare class WABAClient {
|
|
|
73
73
|
* Graph `POST /{templateId}/unpause` (WATS-153). Template-id scoped edge
|
|
74
74
|
* that unpauses a paused template. Delegates to the endpoint-registry
|
|
75
75
|
* callable; the bound wabaId is not used (mirrors getMessageTemplate).
|
|
76
|
-
* The endpoint/response shape is UNVERIFIED — see
|
|
76
|
+
* The endpoint/response shape is UNVERIFIED — see maintainers/template-management-reference.md.
|
|
77
77
|
*/
|
|
78
78
|
unpauseTemplate(params: UnpauseTemplateInput, opts?: EndpointInvokeOptions): Promise<TemplateUnpauseResult>;
|
|
79
79
|
/**
|
|
@@ -82,7 +82,7 @@ export declare class WABAClient {
|
|
|
82
82
|
* into the bound destination WABA. Mirrors pywa's
|
|
83
83
|
* `WhatsApp.migrate_templates`. The bound wabaId is used as the
|
|
84
84
|
* destination and wins over any caller-supplied `destinationWabaId`
|
|
85
|
-
* (mirrors `migrateFlows`).
|
|
85
|
+
* (mirrors `migrateFlows`).
|
|
86
86
|
*/
|
|
87
87
|
migrateTemplates(params: Omit<MigrateTemplatesInput, "destinationWabaId">, opts?: EndpointInvokeOptions): Promise<MigrateTemplatesResponse>;
|
|
88
88
|
/**
|
|
@@ -92,7 +92,7 @@ export declare class WABAClient {
|
|
|
92
92
|
* `GraphClient.requestRaw` (not `defineEndpoint`) because the endpoint
|
|
93
93
|
* lives on api.facebook.com, not graph.facebook.com. The bound wabaId is
|
|
94
94
|
* used in the path and wins over any caller-supplied `wabaId` (mirrors
|
|
95
|
-
* `migrateTemplates`). See
|
|
95
|
+
* `migrateTemplates`). See maintainers/template-management-reference.md §5.
|
|
96
96
|
*/
|
|
97
97
|
archiveTemplates(params: Omit<ArchiveTemplatesInput, "wabaId">, opts?: EndpointInvokeOptions): Promise<ArchiveTemplatesResponse>;
|
|
98
98
|
/**
|
|
@@ -102,7 +102,7 @@ export declare class WABAClient {
|
|
|
102
102
|
* `GraphClient.requestRaw` (not `defineEndpoint`) because the endpoint
|
|
103
103
|
* lives on api.facebook.com, not graph.facebook.com. The bound wabaId is
|
|
104
104
|
* used in the path and wins over any caller-supplied `wabaId` (mirrors
|
|
105
|
-
* `migrateTemplates`). See
|
|
105
|
+
* `migrateTemplates`). See maintainers/template-management-reference.md §5.
|
|
106
106
|
*/
|
|
107
107
|
unarchiveTemplates(params: Omit<UnarchiveTemplatesInput, "wabaId">, opts?: EndpointInvokeOptions): Promise<UnarchiveTemplatesResponse>;
|
|
108
108
|
/**
|
|
@@ -147,14 +147,14 @@ export declare class WABAClient {
|
|
|
147
147
|
* Graph `GET /{flowId}?fields=metric.name(...).granularity(...)...`
|
|
148
148
|
* (WATS-154). Flow-id scoped edge that returns Flow metrics; the bound
|
|
149
149
|
* wabaId is not used because the path is flow-id scoped (mirrors
|
|
150
|
-
* getFlow / getFlowAssets).
|
|
150
|
+
* getFlow / getFlowAssets).
|
|
151
151
|
*/
|
|
152
152
|
getFlowMetrics(params: GetFlowMetricsInput, opts?: EndpointInvokeOptions): Promise<FlowMetric>;
|
|
153
153
|
/**
|
|
154
154
|
* Graph `POST /{wabaId}/migrate_flows?source_waba_id=...&source_flow_names=...`
|
|
155
155
|
* (WATS-154). Copies (not moves) Flows from a source WABA into the bound
|
|
156
156
|
* destination WABA. Mirrors pywa's `WhatsApp.migrate_flows`. The bound
|
|
157
|
-
* wabaId is used as the destination
|
|
157
|
+
* wabaId is used as the destination.
|
|
158
158
|
*/
|
|
159
159
|
migrateFlows(params: Omit<MigrateFlowsInput, "destinationWabaId">, opts?: EndpointInvokeOptions): Promise<MigrateFlowsResponse>;
|
|
160
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wats/graph",
|
|
3
|
-
"
|
|
3
|
+
"description": "Graph client, transport, endpoints, errors, pagination.",
|
|
4
|
+
"version": "0.5.0-beta",
|
|
4
5
|
"private": false,
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"type": "module",
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
"wats"
|
|
86
87
|
],
|
|
87
88
|
"dependencies": {
|
|
88
|
-
"@wats/crypto": "^0.
|
|
89
|
+
"@wats/crypto": "^0.5.0-beta",
|
|
90
|
+
"@wats/internal-utils": "^0.5.0-beta"
|
|
89
91
|
}
|
|
90
92
|
}
|