@junando/core 0.10.1 → 0.11.1

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 (44) hide show
  1. package/dist/index.d.ts +829 -577
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +1877 -9909
  4. package/dist/index.js.map +1 -0
  5. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  6. package/dist/shared/metrics/index.d.ts +29 -0
  7. package/dist/shared/metrics/index.d.ts.map +1 -0
  8. package/dist/shared/metrics/index.js +131 -0
  9. package/dist/shared/metrics/index.js.map +1 -0
  10. package/package.json +12 -11
  11. package/dist/chunk-3OJNTHWB.js +0 -225
  12. package/dist/chunk-5LNMHOUT.js +0 -229
  13. package/dist/chunk-72FU6SG6.js +0 -236
  14. package/dist/chunk-7SYJ764U.js +0 -579
  15. package/dist/chunk-AZU6S4RC.js +0 -11
  16. package/dist/chunk-BGPI5BQ5.js +0 -27
  17. package/dist/chunk-DKQSWD3S.js +0 -46
  18. package/dist/chunk-H4ND7Z4R.js +0 -504
  19. package/dist/chunk-HVICRLMN.js +0 -742
  20. package/dist/chunk-ID7PWYSN.js +0 -12
  21. package/dist/chunk-KU245W3C.js +0 -16
  22. package/dist/chunk-L67CO4EG.js +0 -1038
  23. package/dist/chunk-MLKGABMK.js +0 -9
  24. package/dist/chunk-MQ4JUE6V.js +0 -447
  25. package/dist/chunk-N5AJP37P.js +0 -385
  26. package/dist/chunk-SIDCDO4Q.js +0 -1315
  27. package/dist/chunk-TDZF3WAT.js +0 -3824
  28. package/dist/chunk-VMBT3R2K.js +0 -0
  29. package/dist/chunk-WWHXKECU.js +0 -100
  30. package/dist/chunk-ZKH7AMP3.js +0 -42
  31. package/dist/chunk-ZOU3QHNL.js +0 -28
  32. package/dist/dist-es-CBFEDVZZ.js +0 -493
  33. package/dist/dist-es-ROXOWRKX.js +0 -22
  34. package/dist/dist-es-S3QCFNII.js +0 -327
  35. package/dist/dist-es-SQCUDQ4Y.js +0 -90
  36. package/dist/dist-es-UWOSB3KA.js +0 -72
  37. package/dist/dist-es-VXERFT35.js +0 -172
  38. package/dist/dist-es-Y44CAW7E.js +0 -385
  39. package/dist/event-streams-2IMLK3TK.js +0 -252
  40. package/dist/event-streams-NLZW3NHF.js +0 -1376
  41. package/dist/loadSso-T6VCDGCZ.js +0 -558
  42. package/dist/signin-BC6ZNJCV.js +0 -653
  43. package/dist/sso-oidc-PTS5E3NX.js +0 -793
  44. package/dist/sts-JSJ57UXB.js +0 -6108
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junando/core",
3
- "version": "0.10.1",
3
+ "version": "0.11.1",
4
4
  "description": "Core domain types, interfaces, and shared utilities for the Junando alerting platform",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -19,19 +19,20 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@anthropic-ai/sdk": "^0.32.0",
23
- "@google/generative-ai": "^0.21.0",
22
+ "@anthropic-ai/sdk": "^0.102.0",
23
+ "@google/generative-ai": "^0.24.1",
24
24
  "@types/opossum": "^8.1.9",
25
- "ioredis": "^5.10.1",
26
- "opossum": "^9.0.0",
27
- "pino": "^9.0.0",
25
+ "ioredis": "^5.11.1",
26
+ "opossum": "^10.0.0",
27
+ "pino": "^10.3.1",
28
28
  "prom-client": "^15.1.3",
29
- "zod": "^3.23.0"
29
+ "yaml": "^2.9.0",
30
+ "zod": "^4.4.3"
30
31
  },
31
32
  "devDependencies": {
32
- "@types/node": "^22.0.0",
33
- "tsup": "^8.0.0",
34
- "typescript": "^5.5.0"
33
+ "@types/node": "^26.0.1",
34
+ "tsdown": "^0.22.8",
35
+ "typescript": "^7.0.2"
35
36
  },
36
37
  "exports": {
37
38
  ".": {
@@ -44,7 +45,7 @@
44
45
  }
45
46
  },
46
47
  "scripts": {
47
- "build": "tsup src/index.ts --format esm --dts --tsconfig tsconfig.build.json",
48
+ "build": "tsdown",
48
49
  "typecheck": "tsc --noEmit",
49
50
  "clean": "rm -rf dist"
50
51
  }
@@ -1,225 +0,0 @@
1
- import {
2
- fromBase64,
3
- toBase64,
4
- toHex
5
- } from "./chunk-H4ND7Z4R.js";
6
- import {
7
- fromArrayBuffer,
8
- toUtf8
9
- } from "./chunk-ZKH7AMP3.js";
10
-
11
- // ../../node_modules/.pnpm/@smithy+node-http-handler@4.6.1/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js
12
- import { Writable } from "stream";
13
- var Collector = class extends Writable {
14
- bufferedBytes = [];
15
- _write(chunk, encoding, callback) {
16
- this.bufferedBytes.push(chunk);
17
- callback();
18
- }
19
- };
20
-
21
- // ../../node_modules/.pnpm/@smithy+node-http-handler@4.6.1/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
22
- var streamCollector = (stream) => {
23
- if (isReadableStreamInstance(stream)) {
24
- return collectReadableStream(stream);
25
- }
26
- return new Promise((resolve, reject) => {
27
- const collector = new Collector();
28
- stream.pipe(collector);
29
- stream.on("error", (err) => {
30
- collector.end();
31
- reject(err);
32
- });
33
- collector.on("error", reject);
34
- collector.on("finish", function() {
35
- const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
36
- resolve(bytes);
37
- });
38
- });
39
- };
40
- var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
41
- async function collectReadableStream(stream) {
42
- const chunks = [];
43
- const reader = stream.getReader();
44
- let isDone = false;
45
- let length = 0;
46
- while (!isDone) {
47
- const { done, value } = await reader.read();
48
- if (value) {
49
- chunks.push(value);
50
- length += value.length;
51
- }
52
- isDone = done;
53
- }
54
- const collected = new Uint8Array(length);
55
- let offset = 0;
56
- for (const chunk of chunks) {
57
- collected.set(chunk, offset);
58
- offset += chunk.length;
59
- }
60
- return collected;
61
- }
62
-
63
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
64
- import { Readable } from "stream";
65
-
66
- // ../../node_modules/.pnpm/@smithy+fetch-http-handler@5.3.17/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
67
- var streamCollector2 = async (stream) => {
68
- if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
69
- if (Blob.prototype.arrayBuffer !== void 0) {
70
- return new Uint8Array(await stream.arrayBuffer());
71
- }
72
- return collectBlob(stream);
73
- }
74
- return collectStream(stream);
75
- };
76
- async function collectBlob(blob) {
77
- const base64 = await readToBase64(blob);
78
- const arrayBuffer = fromBase64(base64);
79
- return new Uint8Array(arrayBuffer);
80
- }
81
- async function collectStream(stream) {
82
- const chunks = [];
83
- const reader = stream.getReader();
84
- let isDone = false;
85
- let length = 0;
86
- while (!isDone) {
87
- const { done, value } = await reader.read();
88
- if (value) {
89
- chunks.push(value);
90
- length += value.length;
91
- }
92
- isDone = done;
93
- }
94
- const collected = new Uint8Array(length);
95
- let offset = 0;
96
- for (const chunk of chunks) {
97
- collected.set(chunk, offset);
98
- offset += chunk.length;
99
- }
100
- return collected;
101
- }
102
- function readToBase64(blob) {
103
- return new Promise((resolve, reject) => {
104
- const reader = new FileReader();
105
- reader.onloadend = () => {
106
- if (reader.readyState !== 2) {
107
- return reject(new Error("Reader aborted too early"));
108
- }
109
- const result = reader.result ?? "";
110
- const commaIndex = result.indexOf(",");
111
- const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
112
- resolve(result.substring(dataOffset));
113
- };
114
- reader.onabort = () => reject(new Error("Read aborted"));
115
- reader.onerror = () => reject(reader.error);
116
- reader.readAsDataURL(blob);
117
- });
118
- }
119
-
120
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/stream-type-check.js
121
- var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
122
-
123
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
124
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
125
- var sdkStreamMixin = (stream) => {
126
- if (!isBlobInstance(stream) && !isReadableStream(stream)) {
127
- const name = stream?.__proto__?.constructor?.name || stream;
128
- throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
129
- }
130
- let transformed = false;
131
- const transformToByteArray = async () => {
132
- if (transformed) {
133
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
134
- }
135
- transformed = true;
136
- return await streamCollector2(stream);
137
- };
138
- const blobToWebStream = (blob) => {
139
- if (typeof blob.stream !== "function") {
140
- throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
141
- }
142
- return blob.stream();
143
- };
144
- return Object.assign(stream, {
145
- transformToByteArray,
146
- transformToString: async (encoding) => {
147
- const buf = await transformToByteArray();
148
- if (encoding === "base64") {
149
- return toBase64(buf);
150
- } else if (encoding === "hex") {
151
- return toHex(buf);
152
- } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") {
153
- return toUtf8(buf);
154
- } else if (typeof TextDecoder === "function") {
155
- return new TextDecoder(encoding).decode(buf);
156
- } else {
157
- throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
158
- }
159
- },
160
- transformToWebStream: () => {
161
- if (transformed) {
162
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
163
- }
164
- transformed = true;
165
- if (isBlobInstance(stream)) {
166
- return blobToWebStream(stream);
167
- } else if (isReadableStream(stream)) {
168
- return stream;
169
- } else {
170
- throw new Error(`Cannot transform payload to web stream, got ${stream}`);
171
- }
172
- }
173
- });
174
- };
175
- var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
176
-
177
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
178
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed.";
179
- var sdkStreamMixin2 = (stream) => {
180
- if (!(stream instanceof Readable)) {
181
- try {
182
- return sdkStreamMixin(stream);
183
- } catch (e) {
184
- const name = stream?.__proto__?.constructor?.name || stream;
185
- throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
186
- }
187
- }
188
- let transformed = false;
189
- const transformToByteArray = async () => {
190
- if (transformed) {
191
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
192
- }
193
- transformed = true;
194
- return await streamCollector(stream);
195
- };
196
- return Object.assign(stream, {
197
- transformToByteArray,
198
- transformToString: async (encoding) => {
199
- const buf = await transformToByteArray();
200
- if (encoding === void 0 || Buffer.isEncoding(encoding)) {
201
- return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
202
- } else {
203
- const decoder = new TextDecoder(encoding);
204
- return decoder.decode(buf);
205
- }
206
- },
207
- transformToWebStream: () => {
208
- if (transformed) {
209
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
210
- }
211
- if (stream.readableFlowing !== null) {
212
- throw new Error("The stream has been consumed by other callbacks.");
213
- }
214
- if (typeof Readable.toWeb !== "function") {
215
- throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
216
- }
217
- transformed = true;
218
- return Readable.toWeb(stream);
219
- }
220
- });
221
- };
222
-
223
- export {
224
- sdkStreamMixin2 as sdkStreamMixin
225
- };
@@ -1,229 +0,0 @@
1
- import {
2
- Uint8ArrayBlobAdapter
3
- } from "./chunk-MQ4JUE6V.js";
4
-
5
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/httpRequest.js
6
- var HttpRequest = class _HttpRequest {
7
- method;
8
- protocol;
9
- hostname;
10
- port;
11
- path;
12
- query;
13
- headers;
14
- username;
15
- password;
16
- fragment;
17
- body;
18
- constructor(options) {
19
- this.method = options.method || "GET";
20
- this.hostname = options.hostname || "localhost";
21
- this.port = options.port;
22
- this.query = options.query || {};
23
- this.headers = options.headers || {};
24
- this.body = options.body;
25
- this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
26
- this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
27
- this.username = options.username;
28
- this.password = options.password;
29
- this.fragment = options.fragment;
30
- }
31
- static clone(request) {
32
- const cloned = new _HttpRequest({
33
- ...request,
34
- headers: { ...request.headers }
35
- });
36
- if (cloned.query) {
37
- cloned.query = cloneQuery(cloned.query);
38
- }
39
- return cloned;
40
- }
41
- static isInstance(request) {
42
- if (!request) {
43
- return false;
44
- }
45
- const req = request;
46
- return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
47
- }
48
- clone() {
49
- return _HttpRequest.clone(this);
50
- }
51
- };
52
- function cloneQuery(query) {
53
- return Object.keys(query).reduce((carry, paramName) => {
54
- const param = query[paramName];
55
- return {
56
- ...carry,
57
- [paramName]: Array.isArray(param) ? [...param] : param
58
- };
59
- }, {});
60
- }
61
-
62
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/httpResponse.js
63
- var HttpResponse = class {
64
- statusCode;
65
- reason;
66
- headers;
67
- body;
68
- constructor(options) {
69
- this.statusCode = options.statusCode;
70
- this.reason = options.reason;
71
- this.headers = options.headers || {};
72
- this.body = options.body;
73
- }
74
- static isInstance(response) {
75
- if (!response)
76
- return false;
77
- const resp = response;
78
- return typeof resp.statusCode === "number" && typeof resp.headers === "object";
79
- }
80
- };
81
-
82
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js
83
- var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
84
- return {
85
- setHttpHandler(handler) {
86
- runtimeConfig.httpHandler = handler;
87
- },
88
- httpHandler() {
89
- return runtimeConfig.httpHandler;
90
- },
91
- updateHttpClientConfig(key, value) {
92
- runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
93
- },
94
- httpHandlerConfigs() {
95
- return runtimeConfig.httpHandler.httpHandlerConfigs();
96
- }
97
- };
98
- };
99
- var resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
100
- return {
101
- httpHandler: httpHandlerExtensionConfiguration.httpHandler()
102
- };
103
- };
104
-
105
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js
106
- var CONTENT_LENGTH_HEADER = "content-length";
107
- function contentLengthMiddleware(bodyLengthChecker) {
108
- return (next) => async (args) => {
109
- const request = args.request;
110
- if (HttpRequest.isInstance(request)) {
111
- const { body, headers } = request;
112
- if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) {
113
- try {
114
- const length = bodyLengthChecker(body);
115
- request.headers = {
116
- ...request.headers,
117
- [CONTENT_LENGTH_HEADER]: String(length)
118
- };
119
- } catch (error) {
120
- }
121
- }
122
- }
123
- return next({
124
- ...args,
125
- request
126
- });
127
- };
128
- }
129
- var contentLengthMiddlewareOptions = {
130
- step: "build",
131
- tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
132
- name: "contentLengthMiddleware",
133
- override: true
134
- };
135
- var getContentLengthPlugin = (options) => ({
136
- applyToStack: (clientStack) => {
137
- clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
138
- }
139
- });
140
-
141
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js
142
- var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
143
- var hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
144
-
145
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js
146
- function buildQueryString(query) {
147
- const parts = [];
148
- for (let key of Object.keys(query).sort()) {
149
- const value = query[key];
150
- key = escapeUri(key);
151
- if (Array.isArray(value)) {
152
- for (let i = 0, iLen = value.length; i < iLen; i++) {
153
- parts.push(`${key}=${escapeUri(value[i])}`);
154
- }
155
- } else {
156
- let qsEntry = key;
157
- if (value || typeof value === "string") {
158
- qsEntry += `=${escapeUri(value)}`;
159
- }
160
- parts.push(qsEntry);
161
- }
162
- }
163
- return parts.join("&");
164
- }
165
-
166
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/querystring-parser/parseQueryString.js
167
- function parseQueryString(querystring) {
168
- const query = {};
169
- querystring = querystring.replace(/^\?/, "");
170
- if (querystring) {
171
- for (const pair of querystring.split("&")) {
172
- let [key, value = null] = pair.split("=");
173
- key = decodeURIComponent(key);
174
- if (value) {
175
- value = decodeURIComponent(value);
176
- }
177
- if (!(key in query)) {
178
- query[key] = value;
179
- } else if (Array.isArray(query[key])) {
180
- query[key].push(value);
181
- } else {
182
- query[key] = [query[key], value];
183
- }
184
- }
185
- }
186
- return query;
187
- }
188
-
189
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/url-parser/parseUrl.js
190
- var parseUrl = (url) => {
191
- if (typeof url === "string") {
192
- return parseUrl(new URL(url));
193
- }
194
- const { hostname, pathname, port, protocol, search } = url;
195
- let query;
196
- if (search) {
197
- query = parseQueryString(search);
198
- }
199
- return {
200
- hostname,
201
- port: port ? parseInt(port) : void 0,
202
- protocol,
203
- path: pathname,
204
- query
205
- };
206
- };
207
-
208
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
209
- var collectBody = async (streamBody = new Uint8Array(), context) => {
210
- if (streamBody instanceof Uint8Array) {
211
- return Uint8ArrayBlobAdapter.mutate(streamBody);
212
- }
213
- if (!streamBody) {
214
- return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
215
- }
216
- const fromContext = context.streamCollector(streamBody);
217
- return Uint8ArrayBlobAdapter.mutate(await fromContext);
218
- };
219
-
220
- export {
221
- collectBody,
222
- HttpRequest,
223
- HttpResponse,
224
- getHttpHandlerExtensionConfiguration,
225
- resolveHttpHandlerRuntimeConfig,
226
- getContentLengthPlugin,
227
- buildQueryString,
228
- parseUrl
229
- };