@8ms/helpers 2.3.41 → 2.3.43
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as BaseNamespace } from "../../../index-DwB8X1lz.mjs";
|
|
2
|
+
import { X as InputDate } from "../../../index-1fBbJGQz.mjs";
|
|
2
3
|
import { t as AwsConfig } from "../../../index-CqTOMR8f.mjs";
|
|
3
4
|
import * as _aws_sdk_client_cloudwatch_logs0 from "@aws-sdk/client-cloudwatch-logs";
|
|
4
5
|
import { CloudWatchLogsClient } from "@aws-sdk/client-cloudwatch-logs";
|
|
@@ -11,12 +12,8 @@ declare const logLevel: {
|
|
|
11
12
|
};
|
|
12
13
|
type LogLevel = typeof logLevel[keyof typeof logLevel];
|
|
13
14
|
type LogEvent = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
app: string;
|
|
17
|
-
environment: string;
|
|
18
|
-
stream: string;
|
|
19
|
-
data: object;
|
|
15
|
+
timestamp: InputDate;
|
|
16
|
+
event: string | object;
|
|
20
17
|
};
|
|
21
18
|
//#endregion
|
|
22
19
|
//#region src/aws/cloudWatchLog/server/AwsCloudWatchLogNamespace.d.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../../_class/index.mjs";
|
|
2
|
+
import { getLuxonDate } from "../../../date/index.mjs";
|
|
2
3
|
import { t as getConfig } from "../../../server-Bwy4JI8Z.mjs";
|
|
3
4
|
|
|
4
5
|
//#region src/aws/cloudWatchLog/server/AwsCloudWatchLogNamespace.ts
|
|
@@ -68,7 +69,7 @@ var AwsCloudWatchLogNamespace = class extends BaseNamespace {
|
|
|
68
69
|
logGroupName,
|
|
69
70
|
logStreamName,
|
|
70
71
|
logEvents: logEvents.map((event) => ({
|
|
71
|
-
timestamp: event.
|
|
72
|
+
timestamp: getLuxonDate(event.timestamp).toUnixInteger(),
|
|
72
73
|
message: typeof event === "string" ? event : JSON.stringify(event)
|
|
73
74
|
}))
|
|
74
75
|
}));
|
|
@@ -2,6 +2,16 @@ import { t as BaseNamespace } from "../../index-DwB8X1lz.mjs";
|
|
|
2
2
|
import * as _1password_sdk0 from "@1password/sdk";
|
|
3
3
|
import { Client } from "@1password/sdk";
|
|
4
4
|
|
|
5
|
+
//#region src/onePassword/server/getIdsFromUrl.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Return the vault ID and item ID from an internal secret URL.
|
|
8
|
+
* Eg. https://start.1password.com/open/i?a=AAA&v=VVV&i=III&h=HHH would return vaultId = VVV and itemId = III.
|
|
9
|
+
*/
|
|
10
|
+
declare const getIdsFromUrl: (url: string) => {
|
|
11
|
+
vaultId: string;
|
|
12
|
+
itemId: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
5
15
|
//#region src/onePassword/server/OnePasswordNamespace.d.ts
|
|
6
16
|
declare class OnePasswordNamespace extends BaseNamespace {
|
|
7
17
|
client: Client;
|
|
@@ -21,4 +31,4 @@ type OnePasswordConfig = {
|
|
|
21
31
|
};
|
|
22
32
|
declare const onePasswordClient: (key?: string, config?: OnePasswordConfig) => Promise<OnePasswordNamespace>;
|
|
23
33
|
//#endregion
|
|
24
|
-
export { OnePasswordConfig, type OnePasswordNamespace, onePasswordClient };
|
|
34
|
+
export { OnePasswordConfig, type OnePasswordNamespace, getIdsFromUrl, onePasswordClient };
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
2
|
|
|
3
|
+
//#region src/onePassword/server/getIdsFromUrl.ts
|
|
4
|
+
/**
|
|
5
|
+
* Return the vault ID and item ID from an internal secret URL.
|
|
6
|
+
* Eg. https://start.1password.com/open/i?a=AAA&v=VVV&i=III&h=HHH would return vaultId = VVV and itemId = III.
|
|
7
|
+
*/
|
|
8
|
+
const getIdsFromUrl = (url) => {
|
|
9
|
+
const parsedUrl = new URL(url);
|
|
10
|
+
return {
|
|
11
|
+
vaultId: parsedUrl.searchParams.get("v"),
|
|
12
|
+
itemId: parsedUrl.searchParams.get("i")
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
3
17
|
//#region src/onePassword/server/OnePasswordNamespace.ts
|
|
4
18
|
var OnePasswordNamespace = class extends BaseNamespace {
|
|
5
19
|
ensureInit = async () => {
|
|
@@ -47,4 +61,4 @@ const onePasswordClient = async (key = "default", config) => {
|
|
|
47
61
|
};
|
|
48
62
|
|
|
49
63
|
//#endregion
|
|
50
|
-
export { OnePasswordNamespace, onePasswordClient };
|
|
64
|
+
export { OnePasswordNamespace, getIdsFromUrl, onePasswordClient };
|