@anuma/sdk 1.0.0-next.20260224164627

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.
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/next/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ withAnuma: () => withAnuma
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var withAnuma = (nextConfig = {}) => {
27
+ return {
28
+ ...nextConfig,
29
+ serverExternalPackages: [...nextConfig.serverExternalPackages || [], "sharp"],
30
+ webpack: (config, options) => {
31
+ const { isServer } = options;
32
+ if (!isServer) {
33
+ config.resolve.alias = {
34
+ ...config.resolve.alias,
35
+ sharp: false
36
+ };
37
+ }
38
+ config.module.rules.push({
39
+ test: /\.node$/,
40
+ type: "asset/resource"
41
+ });
42
+ config.resolve.fallback = {
43
+ ...config.resolve.fallback,
44
+ fs: false,
45
+ net: false,
46
+ tls: false,
47
+ child_process: false,
48
+ "node:fs": false,
49
+ "node:path": false
50
+ };
51
+ if (typeof nextConfig.webpack === "function") {
52
+ return nextConfig.webpack(config, options);
53
+ }
54
+ return config;
55
+ }
56
+ };
57
+ };
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ withAnuma
61
+ });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Next.js configuration plugin for @anuma/sdk
3
+ *
4
+ * Use this to automatically configure Webpack aliases and server exclusions
5
+ * needed for the SDK's dependencies.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // next.config.ts
10
+ * import { withAnuma } from "@anuma/sdk/next";
11
+ *
12
+ * const nextConfig = {
13
+ * // your config...
14
+ * };
15
+ *
16
+ * export default withAnuma(nextConfig);
17
+ * ```
18
+ *
19
+ * @module
20
+ */
21
+ declare const withAnuma: (nextConfig?: any) => any;
22
+
23
+ export { withAnuma };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Next.js configuration plugin for @anuma/sdk
3
+ *
4
+ * Use this to automatically configure Webpack aliases and server exclusions
5
+ * needed for the SDK's dependencies.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // next.config.ts
10
+ * import { withAnuma } from "@anuma/sdk/next";
11
+ *
12
+ * const nextConfig = {
13
+ * // your config...
14
+ * };
15
+ *
16
+ * export default withAnuma(nextConfig);
17
+ * ```
18
+ *
19
+ * @module
20
+ */
21
+ declare const withAnuma: (nextConfig?: any) => any;
22
+
23
+ export { withAnuma };
@@ -0,0 +1,36 @@
1
+ // src/next/index.ts
2
+ var withAnuma = (nextConfig = {}) => {
3
+ return {
4
+ ...nextConfig,
5
+ serverExternalPackages: [...nextConfig.serverExternalPackages || [], "sharp"],
6
+ webpack: (config, options) => {
7
+ const { isServer } = options;
8
+ if (!isServer) {
9
+ config.resolve.alias = {
10
+ ...config.resolve.alias,
11
+ sharp: false
12
+ };
13
+ }
14
+ config.module.rules.push({
15
+ test: /\.node$/,
16
+ type: "asset/resource"
17
+ });
18
+ config.resolve.fallback = {
19
+ ...config.resolve.fallback,
20
+ fs: false,
21
+ net: false,
22
+ tls: false,
23
+ child_process: false,
24
+ "node:fs": false,
25
+ "node:path": false
26
+ };
27
+ if (typeof nextConfig.webpack === "function") {
28
+ return nextConfig.webpack(config, options);
29
+ }
30
+ return config;
31
+ }
32
+ };
33
+ };
34
+ export {
35
+ withAnuma
36
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/polyfills/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ needsTextDecoderStreamPolyfill: () => needsPolyfill
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/lib/polyfills/textDecoderStream.ts
28
+ var needsPolyfill = typeof globalThis.TextDecoderStream === "undefined";
29
+ if (needsPolyfill && typeof globalThis.TransformStream !== "undefined") {
30
+ class TextDecoderStreamPolyfill {
31
+ constructor(label = "utf-8", options) {
32
+ this.decoder = new TextDecoder(label, options);
33
+ const decoder = this.decoder;
34
+ this.transform = new TransformStream({
35
+ transform(chunk, controller) {
36
+ const text = decoder.decode(chunk, { stream: true });
37
+ if (text) {
38
+ controller.enqueue(text);
39
+ }
40
+ },
41
+ flush(controller) {
42
+ const text = decoder.decode();
43
+ if (text) {
44
+ controller.enqueue(text);
45
+ }
46
+ }
47
+ });
48
+ }
49
+ get readable() {
50
+ return this.transform.readable;
51
+ }
52
+ get writable() {
53
+ return this.transform.writable;
54
+ }
55
+ }
56
+ globalThis.TextDecoderStream = TextDecoderStreamPolyfill;
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ needsTextDecoderStreamPolyfill
61
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * TextDecoderStream polyfill for React Native compatibility.
3
+ *
4
+ * React Native doesn't have TextDecoderStream, but it does have TextDecoder.
5
+ * This polyfill creates a TransformStream that uses TextDecoder internally.
6
+ */
7
+ declare const needsPolyfill: boolean;
8
+
9
+ export { needsPolyfill as needsTextDecoderStreamPolyfill };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * TextDecoderStream polyfill for React Native compatibility.
3
+ *
4
+ * React Native doesn't have TextDecoderStream, but it does have TextDecoder.
5
+ * This polyfill creates a TransformStream that uses TextDecoder internally.
6
+ */
7
+ declare const needsPolyfill: boolean;
8
+
9
+ export { needsPolyfill as needsTextDecoderStreamPolyfill };
@@ -0,0 +1,34 @@
1
+ // src/lib/polyfills/textDecoderStream.ts
2
+ var needsPolyfill = typeof globalThis.TextDecoderStream === "undefined";
3
+ if (needsPolyfill && typeof globalThis.TransformStream !== "undefined") {
4
+ class TextDecoderStreamPolyfill {
5
+ constructor(label = "utf-8", options) {
6
+ this.decoder = new TextDecoder(label, options);
7
+ const decoder = this.decoder;
8
+ this.transform = new TransformStream({
9
+ transform(chunk, controller) {
10
+ const text = decoder.decode(chunk, { stream: true });
11
+ if (text) {
12
+ controller.enqueue(text);
13
+ }
14
+ },
15
+ flush(controller) {
16
+ const text = decoder.decode();
17
+ if (text) {
18
+ controller.enqueue(text);
19
+ }
20
+ }
21
+ });
22
+ }
23
+ get readable() {
24
+ return this.transform.readable;
25
+ }
26
+ get writable() {
27
+ return this.transform.writable;
28
+ }
29
+ }
30
+ globalThis.TextDecoderStream = TextDecoderStreamPolyfill;
31
+ }
32
+ export {
33
+ needsPolyfill as needsTextDecoderStreamPolyfill
34
+ };
@@ -0,0 +1,25 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+
12
+ // src/clientConfig.ts
13
+ var BASE_URL = "https://portal.anuma-dev.ai";
14
+ var MCP_R2_DOMAIN = "ai-image-mcp-images.4cf0e0ea50b97e72386fcf2f92a2d4e8.r2.cloudflarestorage.com";
15
+ var createClientConfig = (config) => ({
16
+ ...config,
17
+ baseUrl: BASE_URL
18
+ });
19
+
20
+ export {
21
+ __decorateClass,
22
+ BASE_URL,
23
+ MCP_R2_DOMAIN,
24
+ createClientConfig
25
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ BASE_URL,
3
+ MCP_R2_DOMAIN,
4
+ createClientConfig
5
+ } from "./chunk-LJYAMK62.mjs";
6
+ export {
7
+ BASE_URL,
8
+ MCP_R2_DOMAIN,
9
+ createClientConfig
10
+ };