@anuma/sdk 1.0.0
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/expo/chunk-LJYAMK62.mjs +25 -0
- package/dist/expo/chunk-MJJIYFAX.mjs +25 -0
- package/dist/expo/chunk-PJCZO4BQ.mjs +25 -0
- package/dist/expo/clientConfig-2MI4KULF.mjs +10 -0
- package/dist/expo/clientConfig-QDAXFL3W.mjs +10 -0
- package/dist/expo/clientConfig-R4IOW7I2.mjs +10 -0
- package/dist/expo/index.cjs +7858 -0
- package/dist/expo/index.d.mts +2590 -0
- package/dist/expo/index.d.ts +2590 -0
- package/dist/expo/index.mjs +7770 -0
- package/dist/index.cjs +1200 -0
- package/dist/index.d.mts +2796 -0
- package/dist/index.d.ts +2796 -0
- package/dist/index.mjs +1138 -0
- package/dist/next/index.cjs +64 -0
- package/dist/next/index.d.mts +23 -0
- package/dist/next/index.d.ts +23 -0
- package/dist/next/index.mjs +39 -0
- package/dist/polyfills/index.cjs +61 -0
- package/dist/polyfills/index.d.mts +9 -0
- package/dist/polyfills/index.d.ts +9 -0
- package/dist/polyfills/index.mjs +34 -0
- package/dist/react/chunk-LJYAMK62.mjs +25 -0
- package/dist/react/chunk-MJJIYFAX.mjs +25 -0
- package/dist/react/chunk-PJCZO4BQ.mjs +25 -0
- package/dist/react/clientConfig-2MI4KULF.mjs +10 -0
- package/dist/react/clientConfig-QDAXFL3W.mjs +10 -0
- package/dist/react/clientConfig-R4IOW7I2.mjs +10 -0
- package/dist/react/index.cjs +15178 -0
- package/dist/react/index.d.mts +6014 -0
- package/dist/react/index.d.ts +6014 -0
- package/dist/react/index.mjs +14945 -0
- package/dist/tools/chunk-KDFGY4SK.mjs +13 -0
- package/dist/tools/clientConfig-RMDOT5YM.mjs +10 -0
- package/dist/tools/index.cjs +775 -0
- package/dist/tools/index.d.mts +121 -0
- package/dist/tools/index.d.ts +121 -0
- package/dist/tools/index.mjs +741 -0
- package/dist/vercel/index.cjs +86 -0
- package/dist/vercel/index.d.mts +149 -0
- package/dist/vercel/index.d.ts +149 -0
- package/dist/vercel/index.mjs +57 -0
- package/package.json +149 -0
|
@@ -0,0 +1,64 @@
|
|
|
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: [
|
|
30
|
+
...nextConfig.serverExternalPackages || [],
|
|
31
|
+
"sharp"
|
|
32
|
+
],
|
|
33
|
+
webpack: (config, options) => {
|
|
34
|
+
const { isServer } = options;
|
|
35
|
+
if (!isServer) {
|
|
36
|
+
config.resolve.alias = {
|
|
37
|
+
...config.resolve.alias,
|
|
38
|
+
sharp: false
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
config.module.rules.push({
|
|
42
|
+
test: /\.node$/,
|
|
43
|
+
type: "asset/resource"
|
|
44
|
+
});
|
|
45
|
+
config.resolve.fallback = {
|
|
46
|
+
...config.resolve.fallback,
|
|
47
|
+
fs: false,
|
|
48
|
+
net: false,
|
|
49
|
+
tls: false,
|
|
50
|
+
child_process: false,
|
|
51
|
+
"node:fs": false,
|
|
52
|
+
"node:path": false
|
|
53
|
+
};
|
|
54
|
+
if (typeof nextConfig.webpack === "function") {
|
|
55
|
+
return nextConfig.webpack(config, options);
|
|
56
|
+
}
|
|
57
|
+
return config;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
withAnuma
|
|
64
|
+
});
|
|
@@ -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,39 @@
|
|
|
1
|
+
// src/next/index.ts
|
|
2
|
+
var withAnuma = (nextConfig = {}) => {
|
|
3
|
+
return {
|
|
4
|
+
...nextConfig,
|
|
5
|
+
serverExternalPackages: [
|
|
6
|
+
...nextConfig.serverExternalPackages || [],
|
|
7
|
+
"sharp"
|
|
8
|
+
],
|
|
9
|
+
webpack: (config, options) => {
|
|
10
|
+
const { isServer } = options;
|
|
11
|
+
if (!isServer) {
|
|
12
|
+
config.resolve.alias = {
|
|
13
|
+
...config.resolve.alias,
|
|
14
|
+
sharp: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
config.module.rules.push({
|
|
18
|
+
test: /\.node$/,
|
|
19
|
+
type: "asset/resource"
|
|
20
|
+
});
|
|
21
|
+
config.resolve.fallback = {
|
|
22
|
+
...config.resolve.fallback,
|
|
23
|
+
fs: false,
|
|
24
|
+
net: false,
|
|
25
|
+
tls: false,
|
|
26
|
+
child_process: false,
|
|
27
|
+
"node:fs": false,
|
|
28
|
+
"node:path": false
|
|
29
|
+
};
|
|
30
|
+
if (typeof nextConfig.webpack === "function") {
|
|
31
|
+
return nextConfig.webpack(config, options);
|
|
32
|
+
}
|
|
33
|
+
return config;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
withAnuma
|
|
39
|
+
};
|
|
@@ -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,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 = "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,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://ai-portal-dev.zetachain.com";
|
|
14
|
+
var MCP_R2_DOMAIN = "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
|
+
};
|