@spacefast/wpcloud-sdk 0.0.2

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.
Files changed (59) hide show
  1. package/README.md +38 -0
  2. package/dist/fake/index.d.ts +4 -0
  3. package/dist/fake/index.d.ts.map +1 -0
  4. package/dist/fake/index.js +3 -0
  5. package/dist/fake/router.d.ts +17 -0
  6. package/dist/fake/router.d.ts.map +1 -0
  7. package/dist/fake/router.js +188 -0
  8. package/dist/fake/server.d.ts +10 -0
  9. package/dist/fake/server.d.ts.map +1 -0
  10. package/dist/fake/server.js +62 -0
  11. package/dist/fake/store.d.ts +67 -0
  12. package/dist/fake/store.d.ts.map +1 -0
  13. package/dist/fake/store.js +174 -0
  14. package/dist/generated/client/client.gen.d.ts +3 -0
  15. package/dist/generated/client/client.gen.d.ts.map +1 -0
  16. package/dist/generated/client/client.gen.js +216 -0
  17. package/dist/generated/client/index.d.ts +8 -0
  18. package/dist/generated/client/index.d.ts.map +1 -0
  19. package/dist/generated/client/index.js +5 -0
  20. package/dist/generated/client/types.gen.d.ts +125 -0
  21. package/dist/generated/client/types.gen.d.ts.map +1 -0
  22. package/dist/generated/client/types.gen.js +2 -0
  23. package/dist/generated/client/utils.gen.d.ts +39 -0
  24. package/dist/generated/client/utils.gen.d.ts.map +1 -0
  25. package/dist/generated/client/utils.gen.js +228 -0
  26. package/dist/generated/client.gen.d.ts +13 -0
  27. package/dist/generated/client.gen.d.ts.map +1 -0
  28. package/dist/generated/client.gen.js +7 -0
  29. package/dist/generated/core/auth.gen.d.ts +19 -0
  30. package/dist/generated/core/auth.gen.d.ts.map +1 -0
  31. package/dist/generated/core/auth.gen.js +14 -0
  32. package/dist/generated/core/bodySerializer.gen.d.ts +18 -0
  33. package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
  34. package/dist/generated/core/bodySerializer.gen.js +57 -0
  35. package/dist/generated/core/params.gen.d.ts +34 -0
  36. package/dist/generated/core/params.gen.d.ts.map +1 -0
  37. package/dist/generated/core/params.gen.js +88 -0
  38. package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
  39. package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
  40. package/dist/generated/core/pathSerializer.gen.js +106 -0
  41. package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
  42. package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
  43. package/dist/generated/core/serverSentEvents.gen.js +131 -0
  44. package/dist/generated/core/types.gen.d.ts +79 -0
  45. package/dist/generated/core/types.gen.d.ts.map +1 -0
  46. package/dist/generated/core/types.gen.js +2 -0
  47. package/dist/generated/core/utils.gen.d.ts +15 -0
  48. package/dist/generated/core/utils.gen.d.ts.map +1 -0
  49. package/dist/generated/core/utils.gen.js +69 -0
  50. package/dist/generated/sdk.gen.d.ts +840 -0
  51. package/dist/generated/sdk.gen.d.ts.map +1 -0
  52. package/dist/generated/sdk.gen.js +2198 -0
  53. package/dist/generated/types.gen.d.ts +7970 -0
  54. package/dist/generated/types.gen.d.ts.map +1 -0
  55. package/dist/generated/types.gen.js +2 -0
  56. package/dist/runtime.d.ts +24 -0
  57. package/dist/runtime.d.ts.map +1 -0
  58. package/dist/runtime.js +486 -0
  59. package/package.json +36 -0
@@ -0,0 +1,486 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { createClient, createConfig } from "./generated/client";
5
+ const WP_CLOUD_REQUEST_TIMEOUT_MS = 30_000;
6
+ const OPTIONAL_PATH_SEGMENT_PATTERN = /\[\/([^\]]+)\]/g;
7
+ const SNAPSHOT_VERSION = 1;
8
+ export class WpCloudRequestError extends Error {
9
+ status;
10
+ payload;
11
+ constructor(status, message, payload) {
12
+ super(message);
13
+ this.name = "WpCloudRequestError";
14
+ this.status = status;
15
+ this.payload = payload;
16
+ }
17
+ }
18
+ let defaultProviderName = null;
19
+ export function setDefaultWpCloudProviderName(clientName) {
20
+ defaultProviderName = clientName?.trim().toLowerCase() || null;
21
+ }
22
+ let fakeFetchOverride = null;
23
+ /**
24
+ * Test-only seam: route every wp.cloud call to an in-process fake instead of the network. Set in a
25
+ * suite's `beforeAll`, clear with `null` in `afterAll`. Used when the provider mode is `fake`; with
26
+ * no override installed, `fake` mode falls back to the shared default fake server. Mirrors the
27
+ * shape of {@link setDefaultWpCloudProviderName}.
28
+ */
29
+ export function setWpCloudFakeFetch(fn) {
30
+ fakeFetchOverride = fn;
31
+ }
32
+ export const createClientConfig = (config) => ({
33
+ ...config,
34
+ fetch: wpCloudFetch,
35
+ bodySerializer: wpCloudFormBodySerializer,
36
+ headers: {
37
+ "Content-Type": "application/x-www-form-urlencoded",
38
+ ...config?.headers,
39
+ },
40
+ requestValidator: prepareWpCloudRequest,
41
+ responseTransformer: extractData,
42
+ });
43
+ // Build a standalone WP.Cloud client bound to a specific account token (and
44
+ // optional base URL). Use this to make calls under a tenant's own WP.Cloud
45
+ // client instead of the global default; pass the returned client as the
46
+ // `client` option to any generated SDK function, with the matching `{client}`
47
+ // path name.
48
+ export function createWpCloudClient(options) {
49
+ return createClient(createClientConfig(createConfig({
50
+ baseUrl: options.baseUrl ?? "https://atomic-api.wordpress.com/api/v1.0/",
51
+ throwOnError: true,
52
+ auth: options.auth,
53
+ })));
54
+ }
55
+ async function wpCloudFetch(input, init) {
56
+ const response = await wpCloudRawFetch(input, init);
57
+ return await handleWpCloudResponse(response);
58
+ }
59
+ export async function wpCloudRawFetch(input, init) {
60
+ const mode = wpCloudProviderMode();
61
+ if (mode === "fake") {
62
+ const fake = fakeFetchOverride ?? (await import("./fake/server.js")).defaultFakeFetch;
63
+ return await fake(input, init);
64
+ }
65
+ const snapshot = await buildWpCloudSnapshotRequest(input, init);
66
+ if (mode === "replay") {
67
+ return await replayWpCloudSnapshot(snapshot);
68
+ }
69
+ const response = await wpCloudNetworkFetch(input, init);
70
+ if (mode === "record") {
71
+ return await recordWpCloudSnapshot(snapshot, response);
72
+ }
73
+ return response;
74
+ }
75
+ async function wpCloudNetworkFetch(input, init) {
76
+ const controller = new AbortController();
77
+ let didTimeout = false;
78
+ const timeout = setTimeout(() => {
79
+ didTimeout = true;
80
+ controller.abort();
81
+ }, WP_CLOUD_REQUEST_TIMEOUT_MS);
82
+ const abort = () => controller.abort(init?.signal?.reason);
83
+ if (init?.signal?.aborted) {
84
+ abort();
85
+ }
86
+ else {
87
+ init?.signal?.addEventListener("abort", abort, { once: true });
88
+ }
89
+ let response;
90
+ try {
91
+ response = await fetch(input, { ...init, signal: controller.signal });
92
+ }
93
+ catch (error) {
94
+ if (didTimeout) {
95
+ throw new WpCloudRequestError(408, "wp_cloud_request_timeout", null);
96
+ }
97
+ throw error;
98
+ }
99
+ finally {
100
+ clearTimeout(timeout);
101
+ init?.signal?.removeEventListener("abort", abort);
102
+ }
103
+ return response;
104
+ }
105
+ let manifestWriteQueue = Promise.resolve();
106
+ function wpCloudProviderMode() {
107
+ const mode = (process.env.E2E_PROVIDER_MODE ??
108
+ process.env.WP_CLOUD_PROVIDER_MODE ??
109
+ "live").toLowerCase();
110
+ if (mode === "record" || mode === "replay" || mode === "fake") {
111
+ return mode;
112
+ }
113
+ return "live";
114
+ }
115
+ function wpCloudSnapshotDir() {
116
+ const baseDir = process.env.E2E_WPCLOUD_SNAPSHOT_DIR ?? process.env.WP_CLOUD_SNAPSHOT_DIR;
117
+ if (!baseDir) {
118
+ return undefined;
119
+ }
120
+ const snapshotCase = snapshotCaseName();
121
+ return snapshotCase ? path.join(baseDir, snapshotCase) : baseDir;
122
+ }
123
+ function requireWpCloudSnapshotDir() {
124
+ const dir = wpCloudSnapshotDir();
125
+ if (!dir) {
126
+ throw new WpCloudRequestError(599, "wp_cloud_snapshot_dir_required", null);
127
+ }
128
+ return dir;
129
+ }
130
+ async function buildWpCloudSnapshotRequest(input, init) {
131
+ const url = canonicalWpCloudSnapshotUrl(input);
132
+ const method = (init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase();
133
+ const bodySha256 = sha256(await requestBodyForSnapshot(init?.body));
134
+ const key = sha256(`${method}\n${url}\n${bodySha256}`);
135
+ return {
136
+ key,
137
+ method,
138
+ url,
139
+ bodySha256,
140
+ };
141
+ }
142
+ function canonicalWpCloudSnapshotUrl(input) {
143
+ const rawUrl = input instanceof Request ? input.url : String(input);
144
+ const url = new URL(rawUrl);
145
+ url.searchParams.sort();
146
+ return url.toString();
147
+ }
148
+ async function requestBodyForSnapshot(body) {
149
+ if (body === undefined || body === null) {
150
+ return "";
151
+ }
152
+ if (typeof body === "string") {
153
+ return body;
154
+ }
155
+ if (body instanceof URLSearchParams) {
156
+ return body.toString();
157
+ }
158
+ if (body instanceof Blob) {
159
+ return await body.text();
160
+ }
161
+ if (body instanceof ArrayBuffer) {
162
+ return Buffer.from(body).toString("base64");
163
+ }
164
+ if (ArrayBuffer.isView(body)) {
165
+ return Buffer.from(body.buffer, body.byteOffset, body.byteLength).toString("base64");
166
+ }
167
+ return `[${body.constructor.name}]`;
168
+ }
169
+ async function replayWpCloudSnapshot(request) {
170
+ const snapshot = await readWpCloudSnapshot(request);
171
+ if (!snapshot) {
172
+ throw new WpCloudRequestError(599, `wp_cloud_snapshot_missing:${request.key}`, {
173
+ method: request.method,
174
+ url: request.url,
175
+ bodySha256: request.bodySha256,
176
+ });
177
+ }
178
+ assertSnapshotMatches(request, snapshot);
179
+ return new Response(Buffer.from(snapshot.response.bodyBase64, "base64"), {
180
+ status: snapshot.response.status,
181
+ statusText: snapshot.response.statusText,
182
+ headers: snapshot.response.headers,
183
+ });
184
+ }
185
+ async function recordWpCloudSnapshot(request, response) {
186
+ const body = Buffer.from(await response.arrayBuffer());
187
+ // The live caller gets the untouched body (it may need real values, e.g. an SFTP password to
188
+ // SSH in during the same run). Only what we PERSIST is scrubbed: create-site and friends return
189
+ // secrets in their JSON bodies, and these snapshots are committed as fixtures.
190
+ const storedBody = redactSnapshotResponseBody(body);
191
+ const bodyBase64 = storedBody.toString("base64");
192
+ const recordedAt = new Date().toISOString();
193
+ const headers = redactedResponseHeaders(response.headers);
194
+ const snapshot = {
195
+ version: SNAPSHOT_VERSION,
196
+ recordedAt,
197
+ ...request,
198
+ response: {
199
+ status: response.status,
200
+ statusText: response.statusText,
201
+ headers,
202
+ bodyBase64,
203
+ },
204
+ };
205
+ const destination = wpCloudSnapshotWritePath(request);
206
+ await mkdir(path.dirname(destination), { recursive: true });
207
+ await writeJsonAtomic(destination, snapshot);
208
+ await writeWpCloudSnapshotManifest({
209
+ ...request,
210
+ redactedUrl: redactedSnapshotUrl(request.url),
211
+ recordedAt,
212
+ response: {
213
+ status: response.status,
214
+ statusText: response.statusText,
215
+ headers,
216
+ bodySha256: sha256(bodyBase64),
217
+ bodyBytes: storedBody.byteLength,
218
+ },
219
+ });
220
+ return new Response(body, {
221
+ status: response.status,
222
+ statusText: response.statusText,
223
+ headers: response.headers,
224
+ });
225
+ }
226
+ /** Keys whose values are secrets WP.Cloud returns in response bodies (create-site, sftp users, db). */
227
+ const SENSITIVE_BODY_KEY = /pass(word)?|secret|private[_-]?key|privatekey|credential|sftp_pass|db_pass|one[_-]?time|onetime|otp|nonce|api[_-]?key|access[_-]?token/i;
228
+ /**
229
+ * Scrub secrets from a recorded response body before it is written to a committed fixture, while
230
+ * preserving the JSON SHAPE (keys + types) that the fake provider keys off. Masks values under
231
+ * sensitive keys; runs the existing text scrub over remaining string leaves and non-JSON bodies.
232
+ */
233
+ function redactSnapshotResponseBody(body) {
234
+ if (body.byteLength === 0) {
235
+ return body;
236
+ }
237
+ const text = body.toString("utf8");
238
+ let parsed;
239
+ try {
240
+ parsed = JSON.parse(text);
241
+ }
242
+ catch {
243
+ return Buffer.from(redactSensitiveText(text), "utf8");
244
+ }
245
+ return Buffer.from(JSON.stringify(maskSecretValues(parsed)), "utf8");
246
+ }
247
+ function maskSecretValues(value) {
248
+ if (Array.isArray(value)) {
249
+ return value.map(maskSecretValues);
250
+ }
251
+ if (value && typeof value === "object") {
252
+ const out = {};
253
+ for (const [key, child] of Object.entries(value)) {
254
+ out[key] =
255
+ SENSITIVE_BODY_KEY.test(key) && (typeof child === "string" || typeof child === "number")
256
+ ? "[REDACTED]"
257
+ : maskSecretValues(child);
258
+ }
259
+ return out;
260
+ }
261
+ if (typeof value === "string") {
262
+ return redactSensitiveText(value);
263
+ }
264
+ return value;
265
+ }
266
+ async function writeWpCloudSnapshotManifest(entry) {
267
+ manifestWriteQueue = manifestWriteQueue.then(async () => {
268
+ const manifestPath = wpCloudSnapshotManifestPath();
269
+ const manifest = await readWpCloudSnapshotManifest();
270
+ const entries = manifest.entries.filter((existing) => existing.key !== entry.key);
271
+ entries.push(entry);
272
+ entries.sort((left, right) => `${left.method} ${left.redactedUrl} ${left.bodySha256}`.localeCompare(`${right.method} ${right.redactedUrl} ${right.bodySha256}`));
273
+ const next = {
274
+ version: SNAPSHOT_VERSION,
275
+ case: snapshotCaseName(),
276
+ entries,
277
+ };
278
+ await mkdir(path.dirname(manifestPath), { recursive: true });
279
+ await writeJsonAtomic(manifestPath, next);
280
+ });
281
+ await manifestWriteQueue;
282
+ }
283
+ async function readWpCloudSnapshotManifest() {
284
+ try {
285
+ const parsed = JSON.parse(await readFile(wpCloudSnapshotManifestPath(), "utf8"));
286
+ return {
287
+ version: SNAPSHOT_VERSION,
288
+ case: typeof parsed?.case === "string" ? parsed.case : snapshotCaseName(),
289
+ entries: Array.isArray(parsed?.entries) ? parsed.entries : [],
290
+ };
291
+ }
292
+ catch (error) {
293
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
294
+ return {
295
+ version: SNAPSHOT_VERSION,
296
+ case: snapshotCaseName(),
297
+ entries: [],
298
+ };
299
+ }
300
+ throw error;
301
+ }
302
+ }
303
+ async function readWpCloudSnapshot(request) {
304
+ const results = await Promise.allSettled(wpCloudSnapshotReadPaths(request).map(async (snapshotPath) => JSON.parse(await readFile(snapshotPath, "utf8"))));
305
+ for (const result of results) {
306
+ if (result.status === "fulfilled") {
307
+ return result.value;
308
+ }
309
+ const error = result.reason;
310
+ if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT")) {
311
+ throw error;
312
+ }
313
+ }
314
+ return null;
315
+ }
316
+ function wpCloudSnapshotWritePath(request) {
317
+ return path.join(requireWpCloudSnapshotDir(), `${request.key}.json`);
318
+ }
319
+ function wpCloudSnapshotReadPaths(request) {
320
+ const dir = requireWpCloudSnapshotDir();
321
+ const paths = [path.join(dir, `${request.key}.json`)];
322
+ const baseDir = wpCloudSnapshotBaseDir();
323
+ if (baseDir && baseDir !== dir) {
324
+ paths.push(path.join(baseDir, `${request.key}.json`));
325
+ }
326
+ return paths;
327
+ }
328
+ function wpCloudSnapshotBaseDir() {
329
+ return process.env.E2E_WPCLOUD_SNAPSHOT_DIR ?? process.env.WP_CLOUD_SNAPSHOT_DIR;
330
+ }
331
+ function wpCloudSnapshotManifestPath() {
332
+ return path.join(requireWpCloudSnapshotDir(), "_manifest.json");
333
+ }
334
+ function snapshotCaseName() {
335
+ return sanitizeSnapshotCase(process.env.E2E_WPCLOUD_SNAPSHOT_CASE ?? process.env.WP_CLOUD_SNAPSHOT_CASE ?? "");
336
+ }
337
+ function sanitizeSnapshotCase(value) {
338
+ return value
339
+ .trim()
340
+ .toLowerCase()
341
+ .replaceAll(/[^a-z0-9._-]+/g, "-")
342
+ .replaceAll(/^-+|-+$/g, "");
343
+ }
344
+ function redactedSnapshotUrl(value) {
345
+ const url = new URL(value);
346
+ for (const [name, current] of Array.from(url.searchParams.entries())) {
347
+ if (/token|secret|key|password|private|certificate|auth|cookie/i.test(name)) {
348
+ url.searchParams.set(name, "[REDACTED]");
349
+ }
350
+ else {
351
+ url.searchParams.set(name, redactSensitiveText(current));
352
+ }
353
+ }
354
+ return url.toString();
355
+ }
356
+ async function writeJsonAtomic(destination, value) {
357
+ const tempPath = `${destination}.${process.pid}.${Date.now()}.${Math.random()
358
+ .toString(16)
359
+ .slice(2)}.tmp`;
360
+ await writeFile(tempPath, `${JSON.stringify(value, null, 2)}\n`, "utf8");
361
+ await rename(tempPath, destination);
362
+ }
363
+ function assertSnapshotMatches(request, snapshot) {
364
+ if (snapshot.version !== SNAPSHOT_VERSION ||
365
+ snapshot.method !== request.method ||
366
+ snapshot.url !== request.url ||
367
+ snapshot.bodySha256 !== request.bodySha256) {
368
+ throw new WpCloudRequestError(599, `wp_cloud_snapshot_mismatch:${request.key}`, {
369
+ method: request.method,
370
+ url: request.url,
371
+ bodySha256: request.bodySha256,
372
+ });
373
+ }
374
+ }
375
+ function redactedResponseHeaders(headers) {
376
+ const out = {};
377
+ for (const [name, value] of headers) {
378
+ const lowerName = name.toLowerCase();
379
+ if (lowerName === "set-cookie" || lowerName === "authorization" || lowerName === "auth") {
380
+ continue;
381
+ }
382
+ out[lowerName] = redactSensitiveText(value);
383
+ }
384
+ return out;
385
+ }
386
+ function redactSensitiveText(value) {
387
+ return value
388
+ .replace(/Bearer\s+[A-Za-z0-9._~+/-]+=*/gi, "Bearer [REDACTED]")
389
+ .replace(/Auth[=:]\s*[A-Za-z0-9._~+/-]+=*/gi, "Auth=[REDACTED]")
390
+ .replace(/token[=:]\s*["']?[A-Za-z0-9._~+/-]+=*["']?/gi, "token=[REDACTED]");
391
+ }
392
+ function sha256(value) {
393
+ return createHash("sha256").update(value).digest("hex");
394
+ }
395
+ async function handleWpCloudResponse(response) {
396
+ if (response.ok) {
397
+ return response;
398
+ }
399
+ const payload = await readErrorPayload(response);
400
+ const message = payload &&
401
+ typeof payload === "object" &&
402
+ "message" in payload &&
403
+ typeof payload.message === "string"
404
+ ? payload.message
405
+ : `wp_cloud_request_failed:${response.status}`;
406
+ throw new WpCloudRequestError(response.status, message, payload);
407
+ }
408
+ async function readErrorPayload(response) {
409
+ const text = await response.text();
410
+ if (!text) {
411
+ return null;
412
+ }
413
+ try {
414
+ return JSON.parse(text);
415
+ }
416
+ catch {
417
+ return text;
418
+ }
419
+ }
420
+ const ENVELOPE_DATA_KEYS = ["data", "datacenters", "versions"];
421
+ async function extractData(value) {
422
+ if (value && typeof value === "object") {
423
+ if ("response_ticket_id" in value || "job_id" in value) {
424
+ return value;
425
+ }
426
+ for (const key of ENVELOPE_DATA_KEYS) {
427
+ if (key in value)
428
+ return value[key];
429
+ }
430
+ }
431
+ return value;
432
+ }
433
+ function wpCloudFormBodySerializer(body) {
434
+ const encodedForm = new URLSearchParams();
435
+ const append = (key, value) => {
436
+ if (value === undefined || value === null) {
437
+ return;
438
+ }
439
+ if (Array.isArray(value)) {
440
+ for (const [index, item] of value.entries()) {
441
+ append(item && typeof item === "object" && !Array.isArray(item)
442
+ ? `${key}[${index}]`
443
+ : `${key}[]`, item);
444
+ }
445
+ return;
446
+ }
447
+ if (typeof value === "object") {
448
+ for (const [childKey, childValue] of Object.entries(value)) {
449
+ append(`${key}[${childKey}]`, childValue);
450
+ }
451
+ return;
452
+ }
453
+ encodedForm.append(key, String(value));
454
+ };
455
+ for (const [key, value] of Object.entries(body)) {
456
+ append(key, value);
457
+ }
458
+ return encodedForm.toString();
459
+ }
460
+ async function prepareWpCloudRequest(options) {
461
+ if (!options || typeof options !== "object") {
462
+ return;
463
+ }
464
+ const request = options;
465
+ if (request.headers?.get("Content-Type")?.startsWith("application/x-www-form-urlencoded")) {
466
+ request.bodySerializer = wpCloudFormBodySerializer;
467
+ }
468
+ if (typeof request.url !== "string") {
469
+ return;
470
+ }
471
+ request.path ??= {};
472
+ if (defaultProviderName &&
473
+ request.url.includes("{client}") &&
474
+ request.path.client === undefined) {
475
+ request.path.client = defaultProviderName;
476
+ }
477
+ if (defaultProviderName &&
478
+ request.url.includes("{service}") &&
479
+ request.path.service === undefined) {
480
+ request.path.service = defaultProviderName;
481
+ }
482
+ request.url = request.url.replace(OPTIONAL_PATH_SEGMENT_PATTERN, (_segment, name) => {
483
+ const value = request.path?.[name];
484
+ return value === undefined || value === null ? "" : `/${encodeURIComponent(String(value))}`;
485
+ });
486
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@spacefast/wpcloud-sdk",
3
+ "version": "0.0.2",
4
+ "description": "Generated TypeScript client for the WP.Cloud API.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "engines": {
10
+ "bun": "^1.3.11",
11
+ "node": ">=20"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "exports": {
17
+ "./generated/*": {
18
+ "types": "./dist/generated/*.d.ts",
19
+ "import": "./dist/generated/*.js",
20
+ "default": "./dist/generated/*.js"
21
+ },
22
+ "./runtime": {
23
+ "types": "./dist/runtime.d.ts",
24
+ "import": "./dist/runtime.js",
25
+ "default": "./dist/runtime.js"
26
+ },
27
+ "./fake": {
28
+ "types": "./dist/fake/index.d.ts",
29
+ "import": "./dist/fake/index.js",
30
+ "default": "./dist/fake/index.js"
31
+ }
32
+ },
33
+ "dependencies": {
34
+ "@hey-api/client-fetch": "0.13.1"
35
+ }
36
+ }