@gaganref/confect-alchemy 10.6.0-fork.3 → 10.6.0-fork.31
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/dist/Backend.d.ts +64 -5
- package/dist/Backend.d.ts.map +1 -1
- package/dist/Backend.js +187 -3
- package/dist/Backend.js.map +1 -1
- package/dist/Code.d.ts +14 -2
- package/dist/Code.d.ts.map +1 -1
- package/dist/Code.js +2 -2
- package/dist/Code.js.map +1 -1
- package/dist/Confect.d.ts +1 -1
- package/dist/Confect.d.ts.map +1 -1
- package/dist/Confect.js +8 -3
- package/dist/Confect.js.map +1 -1
- package/dist/Convex.d.ts +4 -1
- package/dist/Convex.d.ts.map +1 -1
- package/dist/Convex.js +10 -1
- package/dist/Convex.js.map +1 -1
- package/dist/ConvexClient.d.ts +92 -3
- package/dist/ConvexClient.d.ts.map +1 -1
- package/dist/ConvexClient.js +149 -27
- package/dist/ConvexClient.js.map +1 -1
- package/dist/CustomDomain.d.ts +156 -0
- package/dist/CustomDomain.d.ts.map +1 -0
- package/dist/CustomDomain.js +255 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/DeployKey.js +3 -3
- package/dist/Deployment.d.ts +29 -3
- package/dist/Deployment.d.ts.map +1 -1
- package/dist/Deployment.js +39 -15
- package/dist/Deployment.js.map +1 -1
- package/dist/EnvironmentVariables.d.ts +76 -21
- package/dist/EnvironmentVariables.d.ts.map +1 -1
- package/dist/EnvironmentVariables.js +203 -19
- package/dist/EnvironmentVariables.js.map +1 -1
- package/dist/LogStream.d.ts +134 -0
- package/dist/LogStream.d.ts.map +1 -0
- package/dist/LogStream.js +324 -0
- package/dist/LogStream.js.map +1 -0
- package/dist/Project.js +2 -2
- package/dist/Providers.d.ts.map +1 -1
- package/dist/Providers.js +30 -15
- package/dist/Providers.js.map +1 -1
- package/dist/UsageLimit.d.ts +140 -0
- package/dist/UsageLimit.d.ts.map +1 -0
- package/dist/UsageLimit.js +145 -0
- package/dist/UsageLimit.js.map +1 -0
- package/dist/internal/CodeDeployment.d.ts +28 -1
- package/dist/internal/CodeDeployment.d.ts.map +1 -1
- package/dist/internal/CodeDeployment.js +85 -2
- package/dist/internal/CodeDeployment.js.map +1 -1
- package/dist/internal/CommandRunner.d.ts +4 -0
- package/dist/internal/CommandRunner.d.ts.map +1 -1
- package/dist/internal/CommandRunner.js +92 -6
- package/dist/internal/CommandRunner.js.map +1 -1
- package/dist/internal/FileLock.js +1 -1
- package/dist/internal/FunctionsDirectory.d.ts +12 -0
- package/dist/internal/FunctionsDirectory.d.ts.map +1 -0
- package/dist/internal/FunctionsDirectory.js +22 -0
- package/dist/internal/FunctionsDirectory.js.map +1 -0
- package/dist/internal/Lifecycle.d.ts +1 -0
- package/dist/internal/Lifecycle.d.ts.map +1 -1
- package/dist/internal/Lifecycle.js +24 -2
- package/dist/internal/Lifecycle.js.map +1 -1
- package/dist/internal/LocalBackend.d.ts +9 -0
- package/dist/internal/LocalBackend.d.ts.map +1 -1
- package/dist/internal/LocalBackend.js +14 -5
- package/dist/internal/LocalBackend.js.map +1 -1
- package/dist/internal/LogStream.d.ts +115 -0
- package/dist/internal/LogStream.d.ts.map +1 -0
- package/dist/internal/LogStream.js +123 -0
- package/dist/internal/LogStream.js.map +1 -0
- package/dist/internal/MountInit.d.ts +4 -5
- package/dist/internal/MountInit.d.ts.map +1 -1
- package/dist/internal/MountInit.js +17 -36
- package/dist/internal/MountInit.js.map +1 -1
- package/dist/internal/PushLock.d.ts +1 -0
- package/dist/internal/PushLock.d.ts.map +1 -1
- package/dist/internal/PushLock.js +4 -3
- package/dist/internal/PushLock.js.map +1 -1
- package/dist/internal/ResourceIdentity.js +1 -1
- package/dist/internal/Zip.js +1 -1
- package/package.json +4 -4
- package/src/Backend.ts +422 -12
- package/src/Code.ts +13 -0
- package/src/Confect.ts +7 -1
- package/src/Convex.ts +24 -1
- package/src/ConvexClient.ts +364 -31
- package/src/CustomDomain.ts +453 -0
- package/src/Deployment.ts +74 -12
- package/src/EnvironmentVariables.ts +505 -19
- package/src/LogStream.ts +662 -0
- package/src/Providers.ts +18 -0
- package/src/UsageLimit.ts +253 -0
- package/src/internal/CodeDeployment.ts +115 -0
- package/src/internal/CommandRunner.ts +182 -1
- package/src/internal/FunctionsDirectory.ts +27 -0
- package/src/internal/Lifecycle.ts +21 -1
- package/src/internal/LocalBackend.ts +9 -0
- package/src/internal/LogStream.ts +154 -0
- package/src/internal/MountInit.ts +24 -65
- package/src/internal/PushLock.ts +4 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type * as Redacted from "effect/Redacted";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
export type SecretField = "apiKey" | "ddApiKey" | "dsn" | "accessKeyId" | "secretAccessKey";
|
|
4
|
+
export type RedactInput<A> = A extends unknown ? {
|
|
5
|
+
readonly [K in keyof A]: K extends SecretField ? Redacted.Redacted<string> | Exclude<A[K], string> : K extends "url" ? A[K] | Redacted.Redacted<string> : A[K];
|
|
6
|
+
} : never;
|
|
7
|
+
export type ReadonlyDeep<A> = A extends object ? {
|
|
8
|
+
readonly [K in keyof A]: ReadonlyDeep<A[K]>;
|
|
9
|
+
} : A;
|
|
10
|
+
export declare const Topics: readonly ["verification", "console", "function_execution", "exception", "audit_log", "scheduler_stats", "scheduled_job_lag", "current_storage_usage", "concurrency_stats", "storage_api_bandwidth", "ai_gateway_usage", "log_stream_egress", "custom_audit"];
|
|
11
|
+
export declare const Config: Schema.Union<readonly [Schema.Struct<{
|
|
12
|
+
readonly id: Schema.String;
|
|
13
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
14
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
15
|
+
}>, Schema.Struct<{
|
|
16
|
+
readonly type: Schema.Literal<"failed">;
|
|
17
|
+
readonly reason: Schema.String;
|
|
18
|
+
}>]>;
|
|
19
|
+
readonly logStreamType: Schema.Literal<"datadog">;
|
|
20
|
+
readonly siteLocation: Schema.Literals<readonly ["US1", "US3", "US5", "EU", "US1_FED", "AP1"]>;
|
|
21
|
+
readonly ddTags: Schema.$Array<Schema.String>;
|
|
22
|
+
readonly service: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
23
|
+
readonly topics: Schema.optionalKey<Schema.NullOr<Schema.$Array<Schema.Literals<readonly ["verification", "console", "function_execution", "exception", "audit_log", "scheduler_stats", "scheduled_job_lag", "current_storage_usage", "concurrency_stats", "storage_api_bandwidth", "ai_gateway_usage", "log_stream_egress", "custom_audit"]>>>>;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly id: Schema.String;
|
|
26
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
27
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
readonly type: Schema.Literal<"failed">;
|
|
30
|
+
readonly reason: Schema.String;
|
|
31
|
+
}>]>;
|
|
32
|
+
readonly logStreamType: Schema.Literal<"webhook">;
|
|
33
|
+
readonly url: Schema.String;
|
|
34
|
+
readonly format: Schema.Literals<readonly ["json", "jsonl"]>;
|
|
35
|
+
readonly hmacSecret: Schema.String;
|
|
36
|
+
readonly topics: Schema.optionalKey<Schema.NullOr<Schema.$Array<Schema.Literals<readonly ["verification", "console", "function_execution", "exception", "audit_log", "scheduler_stats", "scheduled_job_lag", "current_storage_usage", "concurrency_stats", "storage_api_bandwidth", "ai_gateway_usage", "log_stream_egress", "custom_audit"]>>>>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly id: Schema.String;
|
|
39
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
40
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"failed">;
|
|
43
|
+
readonly reason: Schema.String;
|
|
44
|
+
}>]>;
|
|
45
|
+
readonly logStreamType: Schema.Literal<"axiom">;
|
|
46
|
+
readonly datasetName: Schema.String;
|
|
47
|
+
readonly attributes: Schema.$Array<Schema.Struct<{
|
|
48
|
+
readonly key: Schema.String;
|
|
49
|
+
readonly value: Schema.String;
|
|
50
|
+
}>>;
|
|
51
|
+
readonly ingestUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
52
|
+
readonly topics: Schema.optionalKey<Schema.NullOr<Schema.$Array<Schema.Literals<readonly ["verification", "console", "function_execution", "exception", "audit_log", "scheduler_stats", "scheduled_job_lag", "current_storage_usage", "concurrency_stats", "storage_api_bandwidth", "ai_gateway_usage", "log_stream_egress", "custom_audit"]>>>>;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly id: Schema.String;
|
|
55
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
56
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
57
|
+
}>, Schema.Struct<{
|
|
58
|
+
readonly type: Schema.Literal<"failed">;
|
|
59
|
+
readonly reason: Schema.String;
|
|
60
|
+
}>]>;
|
|
61
|
+
readonly logStreamType: Schema.Literal<"sentry">;
|
|
62
|
+
readonly tags: Schema.optionalKey<Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>>;
|
|
63
|
+
}>, Schema.Struct<{
|
|
64
|
+
readonly id: Schema.String;
|
|
65
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
66
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
readonly type: Schema.Literal<"failed">;
|
|
69
|
+
readonly reason: Schema.String;
|
|
70
|
+
}>]>;
|
|
71
|
+
readonly logStreamType: Schema.Literal<"postHogLogs">;
|
|
72
|
+
readonly host: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
73
|
+
readonly serviceName: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
74
|
+
readonly topics: Schema.optionalKey<Schema.NullOr<Schema.$Array<Schema.Literals<readonly ["verification", "console", "function_execution", "exception", "audit_log", "scheduler_stats", "scheduled_job_lag", "current_storage_usage", "concurrency_stats", "storage_api_bandwidth", "ai_gateway_usage", "log_stream_egress", "custom_audit"]>>>>;
|
|
75
|
+
}>, Schema.Struct<{
|
|
76
|
+
readonly id: Schema.String;
|
|
77
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
78
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
79
|
+
}>, Schema.Struct<{
|
|
80
|
+
readonly type: Schema.Literal<"failed">;
|
|
81
|
+
readonly reason: Schema.String;
|
|
82
|
+
}>]>;
|
|
83
|
+
readonly logStreamType: Schema.Literal<"postHogErrorTracking">;
|
|
84
|
+
readonly host: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
85
|
+
}>, Schema.Struct<{
|
|
86
|
+
readonly id: Schema.String;
|
|
87
|
+
readonly status: Schema.Union<readonly [Schema.Struct<{
|
|
88
|
+
readonly type: Schema.Literals<readonly ["pending", "restarting", "active", "deleting"]>;
|
|
89
|
+
}>, Schema.Struct<{
|
|
90
|
+
readonly type: Schema.Literal<"failed">;
|
|
91
|
+
readonly reason: Schema.String;
|
|
92
|
+
}>]>;
|
|
93
|
+
readonly logStreamType: Schema.Literal<"s3Export">;
|
|
94
|
+
readonly bucket: Schema.String;
|
|
95
|
+
readonly region: Schema.String;
|
|
96
|
+
readonly prefix: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
97
|
+
readonly accessKeyId: Schema.String;
|
|
98
|
+
readonly period: Schema.Literals<readonly ["continuous", "hourly", "daily"]>;
|
|
99
|
+
readonly selection: Schema.StructWithRest<Schema.Struct<{
|
|
100
|
+
readonly _other: Schema.Literals<readonly ["included", "excluded"]>;
|
|
101
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Literal<"excluded">, Schema.StructWithRest<Schema.Struct<{
|
|
102
|
+
readonly _other: Schema.Literals<readonly ["included", "excluded"]>;
|
|
103
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Literal<"excluded">, Schema.StructWithRest<Schema.Struct<{
|
|
104
|
+
readonly _other: Schema.Literals<readonly ["included", "excluded"]>;
|
|
105
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Literals<readonly ["included", "excluded"]>>]>]>>]>]>>]>;
|
|
106
|
+
}>]>;
|
|
107
|
+
export declare const Created: Schema.Union<readonly [Schema.Struct<{
|
|
108
|
+
readonly logStreamType: Schema.Literal<"webhook">;
|
|
109
|
+
readonly id: Schema.String;
|
|
110
|
+
readonly hmacSecret: Schema.String;
|
|
111
|
+
}>, Schema.Struct<{
|
|
112
|
+
readonly logStreamType: Schema.Literals<readonly ["datadog", "axiom", "sentry", "postHogLogs", "postHogErrorTracking", "s3Export"]>;
|
|
113
|
+
readonly id: Schema.String;
|
|
114
|
+
}>]>;
|
|
115
|
+
//# sourceMappingURL=LogStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogStream.d.ts","sources":["../../src/internal/LogStream.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,UAAU,GACV,KAAK,GACL,aAAa,GACb,iBAAiB,CAAC;AACtB,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC1C;IACE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,WAAW,GAC1C,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GACjD,CAAC,SAAS,KAAK,GACb,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC;CACX,GACD,KAAK,CAAC;AACV,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC1C;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC/C,CAAC,CAAC;AAQN,eAAO,MAAM,MAAM,YACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,CACN,CAAC;AA8BX,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DoD,CAAC;AAExE,eAAO,MAAM,OAAO;;;;;;;IAiB2D,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
// src/internal/LogStream.ts
|
|
3
|
+
const Status = Schema.Union([Schema.Struct({ type: Schema.Literals([
|
|
4
|
+
"pending",
|
|
5
|
+
"restarting",
|
|
6
|
+
"active",
|
|
7
|
+
"deleting"
|
|
8
|
+
]) }), Schema.Struct({
|
|
9
|
+
type: Schema.Literal("failed"),
|
|
10
|
+
reason: Schema.String
|
|
11
|
+
})]);
|
|
12
|
+
const Topics = [
|
|
13
|
+
"verification",
|
|
14
|
+
"console",
|
|
15
|
+
"function_execution",
|
|
16
|
+
"exception",
|
|
17
|
+
"audit_log",
|
|
18
|
+
"scheduler_stats",
|
|
19
|
+
"scheduled_job_lag",
|
|
20
|
+
"current_storage_usage",
|
|
21
|
+
"concurrency_stats",
|
|
22
|
+
"storage_api_bandwidth",
|
|
23
|
+
"ai_gateway_usage",
|
|
24
|
+
"log_stream_egress",
|
|
25
|
+
"custom_audit"
|
|
26
|
+
];
|
|
27
|
+
const TopicSelection = Schema.Array(Schema.Literals(Topics)).pipe(Schema.NullOr, Schema.optionalKey);
|
|
28
|
+
const optionalString = Schema.String.pipe(Schema.NullOr, Schema.optionalKey);
|
|
29
|
+
const Tags = Schema.Record(Schema.String, Schema.String).pipe(Schema.NullOr, Schema.optionalKey);
|
|
30
|
+
const Id = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_+/-]{1,128}$/));
|
|
31
|
+
const base = {
|
|
32
|
+
id: Id,
|
|
33
|
+
status: Status
|
|
34
|
+
};
|
|
35
|
+
const Inclusion = Schema.Literals(["included", "excluded"]);
|
|
36
|
+
const TableSelection = Schema.Union([Schema.Literal("excluded"), Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [Schema.Record(Schema.String, Inclusion)])]);
|
|
37
|
+
const ComponentSelection = Schema.Union([Schema.Literal("excluded"), Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [Schema.Record(Schema.String, TableSelection)])]);
|
|
38
|
+
const Selection = Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [Schema.Record(Schema.String, ComponentSelection)]);
|
|
39
|
+
const Config = Schema.Union([
|
|
40
|
+
Schema.Struct({
|
|
41
|
+
...base,
|
|
42
|
+
logStreamType: Schema.Literal("datadog"),
|
|
43
|
+
siteLocation: Schema.Literals([
|
|
44
|
+
"US1",
|
|
45
|
+
"US3",
|
|
46
|
+
"US5",
|
|
47
|
+
"EU",
|
|
48
|
+
"US1_FED",
|
|
49
|
+
"AP1"
|
|
50
|
+
]),
|
|
51
|
+
ddTags: Schema.Array(Schema.String),
|
|
52
|
+
service: optionalString,
|
|
53
|
+
topics: TopicSelection
|
|
54
|
+
}),
|
|
55
|
+
Schema.Struct({
|
|
56
|
+
...base,
|
|
57
|
+
logStreamType: Schema.Literal("webhook"),
|
|
58
|
+
url: Schema.String,
|
|
59
|
+
format: Schema.Literals(["json", "jsonl"]),
|
|
60
|
+
hmacSecret: Schema.String,
|
|
61
|
+
topics: TopicSelection
|
|
62
|
+
}),
|
|
63
|
+
Schema.Struct({
|
|
64
|
+
...base,
|
|
65
|
+
logStreamType: Schema.Literal("axiom"),
|
|
66
|
+
datasetName: Schema.String,
|
|
67
|
+
attributes: Schema.Array(Schema.Struct({
|
|
68
|
+
key: Schema.String,
|
|
69
|
+
value: Schema.String
|
|
70
|
+
})),
|
|
71
|
+
ingestUrl: optionalString,
|
|
72
|
+
topics: TopicSelection
|
|
73
|
+
}),
|
|
74
|
+
Schema.Struct({
|
|
75
|
+
...base,
|
|
76
|
+
logStreamType: Schema.Literal("sentry"),
|
|
77
|
+
tags: Tags
|
|
78
|
+
}),
|
|
79
|
+
Schema.Struct({
|
|
80
|
+
...base,
|
|
81
|
+
logStreamType: Schema.Literal("postHogLogs"),
|
|
82
|
+
host: optionalString,
|
|
83
|
+
serviceName: optionalString,
|
|
84
|
+
topics: TopicSelection
|
|
85
|
+
}),
|
|
86
|
+
Schema.Struct({
|
|
87
|
+
...base,
|
|
88
|
+
logStreamType: Schema.Literal("postHogErrorTracking"),
|
|
89
|
+
host: optionalString
|
|
90
|
+
}),
|
|
91
|
+
Schema.Struct({
|
|
92
|
+
...base,
|
|
93
|
+
logStreamType: Schema.Literal("s3Export"),
|
|
94
|
+
bucket: Schema.String,
|
|
95
|
+
region: Schema.String,
|
|
96
|
+
prefix: optionalString,
|
|
97
|
+
accessKeyId: Schema.String,
|
|
98
|
+
period: Schema.Literals([
|
|
99
|
+
"continuous",
|
|
100
|
+
"hourly",
|
|
101
|
+
"daily"
|
|
102
|
+
]),
|
|
103
|
+
selection: Selection
|
|
104
|
+
})
|
|
105
|
+
]);
|
|
106
|
+
const Created = Schema.Union([Schema.Struct({
|
|
107
|
+
logStreamType: Schema.Literal("webhook"),
|
|
108
|
+
id: Id,
|
|
109
|
+
hmacSecret: Schema.String
|
|
110
|
+
}), Schema.Struct({
|
|
111
|
+
logStreamType: Schema.Literals([
|
|
112
|
+
"datadog",
|
|
113
|
+
"axiom",
|
|
114
|
+
"sentry",
|
|
115
|
+
"postHogLogs",
|
|
116
|
+
"postHogErrorTracking",
|
|
117
|
+
"s3Export"
|
|
118
|
+
]),
|
|
119
|
+
id: Id
|
|
120
|
+
})]);
|
|
121
|
+
export { Config, Created, Topics };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=LogStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogStream.js","names":[],"sources":["../../src/internal/LogStream.ts"],"sourcesContent":["import type * as DeploymentApi from \"@convex-dev/platform/deploymentApi\";\nimport type * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\n\nexport type SecretField =\n | \"apiKey\"\n | \"ddApiKey\"\n | \"dsn\"\n | \"accessKeyId\"\n | \"secretAccessKey\";\nexport type RedactInput<A> = A extends unknown\n ? {\n readonly [K in keyof A]: K extends SecretField\n ? Redacted.Redacted<string> | Exclude<A[K], string>\n : K extends \"url\"\n ? A[K] | Redacted.Redacted<string>\n : A[K];\n }\n : never;\nexport type ReadonlyDeep<A> = A extends object\n ? { readonly [K in keyof A]: ReadonlyDeep<A[K]> }\n : A;\n\nconst Status = Schema.Union([\n Schema.Struct({\n type: Schema.Literals([\"pending\", \"restarting\", \"active\", \"deleting\"]),\n }),\n Schema.Struct({ type: Schema.Literal(\"failed\"), reason: Schema.String }),\n]);\nexport const Topics = [\n \"verification\",\n \"console\",\n \"function_execution\",\n \"exception\",\n \"audit_log\",\n \"scheduler_stats\",\n \"scheduled_job_lag\",\n \"current_storage_usage\",\n \"concurrency_stats\",\n \"storage_api_bandwidth\",\n \"ai_gateway_usage\",\n \"log_stream_egress\",\n \"custom_audit\",\n] as const;\nconst TopicSelection = Schema.Array(Schema.Literals(Topics)).pipe(\n Schema.NullOr,\n Schema.optionalKey,\n);\nconst optionalString = Schema.String.pipe(Schema.NullOr, Schema.optionalKey);\nconst Tags = Schema.Record(Schema.String, Schema.String).pipe(\n Schema.NullOr,\n Schema.optionalKey,\n);\n// IDs enter recovery errors, so reject response text outside this bounded alphabet.\nconst Id = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_+/-]{1,128}$/));\nconst base = { id: Id, status: Status };\nconst Inclusion = Schema.Literals([\"included\", \"excluded\"]);\nconst TableSelection = Schema.Union([\n Schema.Literal(\"excluded\"),\n Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [\n Schema.Record(Schema.String, Inclusion),\n ]),\n]);\nconst ComponentSelection = Schema.Union([\n Schema.Literal(\"excluded\"),\n Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [\n Schema.Record(Schema.String, TableSelection),\n ]),\n]);\nconst Selection = Schema.StructWithRest(Schema.Struct({ _other: Inclusion }), [\n Schema.Record(Schema.String, ComponentSelection),\n]);\n\nexport const Config = Schema.Union([\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"datadog\"),\n siteLocation: Schema.Literals([\n \"US1\",\n \"US3\",\n \"US5\",\n \"EU\",\n \"US1_FED\",\n \"AP1\",\n ]),\n ddTags: Schema.Array(Schema.String),\n service: optionalString,\n topics: TopicSelection,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"webhook\"),\n url: Schema.String,\n format: Schema.Literals([\"json\", \"jsonl\"]),\n hmacSecret: Schema.String,\n topics: TopicSelection,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"axiom\"),\n datasetName: Schema.String,\n attributes: Schema.Array(\n Schema.Struct({ key: Schema.String, value: Schema.String }),\n ),\n ingestUrl: optionalString,\n topics: TopicSelection,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"sentry\"),\n tags: Tags,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"postHogLogs\"),\n host: optionalString,\n serviceName: optionalString,\n topics: TopicSelection,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"postHogErrorTracking\"),\n host: optionalString,\n }),\n Schema.Struct({\n ...base,\n logStreamType: Schema.Literal(\"s3Export\"),\n bucket: Schema.String,\n region: Schema.String,\n prefix: optionalString,\n accessKeyId: Schema.String,\n period: Schema.Literals([\"continuous\", \"hourly\", \"daily\"]),\n selection: Selection,\n }),\n]) satisfies Schema.Schema<ReadonlyDeep<DeploymentApi.LogStreamConfig>>;\n\nexport const Created = Schema.Union([\n Schema.Struct({\n logStreamType: Schema.Literal(\"webhook\"),\n id: Id,\n hmacSecret: Schema.String,\n }),\n Schema.Struct({\n logStreamType: Schema.Literals([\n \"datadog\",\n \"axiom\",\n \"sentry\",\n \"postHogLogs\",\n \"postHogErrorTracking\",\n \"s3Export\",\n ]),\n id: Id,\n }),\n]) satisfies Schema.Schema<ReadonlyDeep<DeploymentApi.CreateLogStreamResponse>>;\n"],"mappings":";;AAuBA,MAAM,SAAS,OAAO,MAAM,CAC1B,OAAO,OAAO,EACZ,MAAM,OAAO,SAAS;CAAC;CAAW;CAAc;CAAU;AAAU,CAAC,EACvE,CAAC,GACD,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,QAAQ;CAAG,QAAQ,OAAO;AAAO,CAAC,CACzE,CAAC;AACD,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,iBAAiB,OAAO,MAAM,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,KAC3D,OAAO,QACP,OAAO,WACT;AACA,MAAM,iBAAiB,OAAO,OAAO,KAAK,OAAO,QAAQ,OAAO,WAAW;AAC3E,MAAM,OAAO,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,KACvD,OAAO,QACP,OAAO,WACT;AAEA,MAAM,KAAK,OAAO,OAAO,MAAM,OAAO,UAAU,0BAA0B,CAAC;AAC3E,MAAM,OAAO;CAAE,IAAI;CAAI,QAAQ;AAAO;AACtC,MAAM,YAAY,OAAO,SAAS,CAAC,YAAY,UAAU,CAAC;AAC1D,MAAM,iBAAiB,OAAO,MAAM,CAClC,OAAO,QAAQ,UAAU,GACzB,OAAO,eAAe,OAAO,OAAO,EAAE,QAAQ,UAAU,CAAC,GAAG,CAC1D,OAAO,OAAO,OAAO,QAAQ,SAAS,CACxC,CAAC,CACH,CAAC;AACD,MAAM,qBAAqB,OAAO,MAAM,CACtC,OAAO,QAAQ,UAAU,GACzB,OAAO,eAAe,OAAO,OAAO,EAAE,QAAQ,UAAU,CAAC,GAAG,CAC1D,OAAO,OAAO,OAAO,QAAQ,cAAc,CAC7C,CAAC,CACH,CAAC;AACD,MAAM,YAAY,OAAO,eAAe,OAAO,OAAO,EAAE,QAAQ,UAAU,CAAC,GAAG,CAC5E,OAAO,OAAO,OAAO,QAAQ,kBAAkB,CACjD,CAAC;AAED,MAAa,SAAS,OAAO,MAAM;CACjC,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,SAAS;EACvC,cAAc,OAAO,SAAS;GAC5B;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,QAAQ,OAAO,MAAM,OAAO,MAAM;EAClC,SAAS;EACT,QAAQ;CACV,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,SAAS;EACvC,KAAK,OAAO;EACZ,QAAQ,OAAO,SAAS,CAAC,QAAQ,OAAO,CAAC;EACzC,YAAY,OAAO;EACnB,QAAQ;CACV,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,OAAO;EACrC,aAAa,OAAO;EACpB,YAAY,OAAO,MACjB,OAAO,OAAO;GAAE,KAAK,OAAO;GAAQ,OAAO,OAAO;EAAO,CAAC,CAC5D;EACA,WAAW;EACX,QAAQ;CACV,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,QAAQ;EACtC,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,aAAa;EAC3C,MAAM;EACN,aAAa;EACb,QAAQ;CACV,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,sBAAsB;EACpD,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,GAAG;EACH,eAAe,OAAO,QAAQ,UAAU;EACxC,QAAQ,OAAO;EACf,QAAQ,OAAO;EACf,QAAQ;EACR,aAAa,OAAO;EACpB,QAAQ,OAAO,SAAS;GAAC;GAAc;GAAU;EAAO,CAAC;EACzD,WAAW;CACb,CAAC;AACH,CAAC;AAED,MAAa,UAAU,OAAO,MAAM,CAClC,OAAO,OAAO;CACZ,eAAe,OAAO,QAAQ,SAAS;CACvC,IAAI;CACJ,YAAY,OAAO;AACrB,CAAC,GACD,OAAO,OAAO;CACZ,eAAe,OAAO,SAAS;EAC7B;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI;AACN,CAAC,CACH,CAAC"}
|
|
@@ -14,11 +14,10 @@ export declare class MountInitFailed extends MountInitFailed_base {
|
|
|
14
14
|
get message(): string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Run every mount's `init` against a pushed deployment
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* transaction, so earlier mounts stay applied and a rerun converges.
|
|
17
|
+
* Run every mount's `init` against a pushed deployment, in the order
|
|
18
|
+
* `MountSteps.run` walks them, the order the test backend uses too. The first
|
|
19
|
+
* failing mount stops the run. Each `init` is its own transaction, so earlier
|
|
20
|
+
* mounts stay applied and a rerun converges.
|
|
22
21
|
*
|
|
23
22
|
* @internal
|
|
24
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MountInit.d.ts","sources":["../../src/internal/MountInit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MountInit.d.ts","sources":["../../src/internal/MountInit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAC;;;;;oBAKnD,OAAO,MAAM;;AAFjC,qBAAa,eAAgB,SAAQ,oBAGkC;IACrE,IAAa,OAAO,WAEnB;CACF;AAcD;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,sJAgCd,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ConvexClient, ConvexFunctionError } from "../ConvexClient.js";
|
|
2
|
+
import { functionsDirectory } from "./FunctionsDirectory.js";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
3
5
|
import * as FileSystem from "effect/FileSystem";
|
|
4
6
|
import * as Path from "effect/Path";
|
|
5
|
-
import * as
|
|
7
|
+
import * as MountSteps from "@confect/core/MountSteps";
|
|
6
8
|
// src/internal/MountInit.ts
|
|
7
9
|
var MountInitFailed = class extends Schema.TaggedError()("MountInitFailed", {
|
|
8
10
|
mount: Schema.String,
|
|
@@ -12,36 +14,20 @@ var MountInitFailed = class extends Schema.TaggedError()("MountInitFailed", {
|
|
|
12
14
|
return `${this.mount}: init failed; earlier mounts are applied, and the next push retries`;
|
|
13
15
|
}
|
|
14
16
|
};
|
|
15
|
-
const Steps = Schema.Array(Schema.Union([Schema.Struct({
|
|
16
|
-
componentPath: Schema.String,
|
|
17
|
-
nested: Schema.Boolean,
|
|
18
|
-
init: Schema.NullOr(Schema.Struct({
|
|
19
|
-
functionName: Schema.String,
|
|
20
|
-
args: Schema.Unknown
|
|
21
|
-
}))
|
|
22
|
-
}), Schema.Struct({
|
|
23
|
-
componentPath: Schema.String,
|
|
24
|
-
failure: Schema.String
|
|
25
|
-
})]));
|
|
26
|
-
const STEPS = "confectDeploy:steps";
|
|
27
|
-
const ConvexJson = Schema.fromJsonString(Schema.Struct({ functions: Schema.optional(Schema.String) }));
|
|
28
17
|
/**
|
|
29
|
-
* Whether codegen wrote `confectDeploy.ts` into the backend's Convex directory
|
|
30
|
-
* which `convex.json` may move.
|
|
18
|
+
* Whether codegen wrote `confectDeploy.ts` into the backend's Convex directory.
|
|
31
19
|
*/
|
|
32
20
|
const hasDeployModule = Effect.fn("MountInit.hasDeployModule")(function* (cwd) {
|
|
33
21
|
const fs = yield* FileSystem.FileSystem;
|
|
34
22
|
const path = yield* Path.Path;
|
|
35
|
-
const
|
|
36
|
-
const functions = (yield* fs.exists(config)) ? (yield* fs.readFileString(config).pipe(Effect.flatMap(Schema.decodeEffect(ConvexJson)))).functions ?? "convex" : "convex";
|
|
23
|
+
const functions = yield* functionsDirectory(cwd);
|
|
37
24
|
return yield* fs.exists(path.join(cwd, functions, "confectDeploy.ts"));
|
|
38
25
|
});
|
|
39
26
|
/**
|
|
40
|
-
* Run every mount's `init` against a pushed deployment
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* transaction, so earlier mounts stay applied and a rerun converges.
|
|
27
|
+
* Run every mount's `init` against a pushed deployment, in the order
|
|
28
|
+
* `MountSteps.run` walks them, the order the test backend uses too. The first
|
|
29
|
+
* failing mount stops the run. Each `init` is its own transaction, so earlier
|
|
30
|
+
* mounts stay applied and a rerun converges.
|
|
45
31
|
*
|
|
46
32
|
* @internal
|
|
47
33
|
*/
|
|
@@ -50,21 +36,16 @@ const run = Effect.fn("MountInit.run")(function* (url, key, cwd) {
|
|
|
50
36
|
mount,
|
|
51
37
|
detail: Schema.is(ConvexFunctionError)(error) ? error.errorMessage : error._tag
|
|
52
38
|
});
|
|
53
|
-
if (!(yield* hasDeployModule(cwd).pipe(Effect.mapError(failed(STEPS))))) return;
|
|
39
|
+
if (!(yield* hasDeployModule(cwd).pipe(Effect.mapError(failed(MountSteps.STEPS))))) return;
|
|
54
40
|
const client = yield* ConvexClient;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
if (step.init !== null) yield* client.runFunction(url, key, step.init.functionName, step.init.args, mount).pipe(Effect.mapError(failed(mount)));
|
|
64
|
-
if (step.nested) yield* visit(mount);
|
|
65
|
-
}
|
|
41
|
+
yield* MountSteps.run({
|
|
42
|
+
steps: (prefix) => client.runFunction(url, key, MountSteps.STEPS, {}, prefix).pipe(Effect.mapError(failed(prefix ?? MountSteps.STEPS))),
|
|
43
|
+
init: (mount, functionName, args) => client.runFunction(url, key, functionName, args, mount).pipe(Effect.mapError(failed(mount))),
|
|
44
|
+
failed: (mount, detail) => MountInitFailed.make({
|
|
45
|
+
mount,
|
|
46
|
+
detail
|
|
47
|
+
})
|
|
66
48
|
});
|
|
67
|
-
yield* visit(void 0);
|
|
68
49
|
});
|
|
69
50
|
export { MountInitFailed, run };
|
|
70
51
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MountInit.js","names":[],"sources":["../../src/internal/MountInit.ts"],"sourcesContent":["import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport type * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport { ConvexClient, ConvexFunctionError } from \"../ConvexClient.js\";\n\nexport class MountInitFailed extends Schema.TaggedError<\n MountInitFailed,\n { readonly brand: unique symbol }\n>()(\"MountInitFailed\", { mount: Schema.String, detail: Schema.String }) {\n override get message() {\n return `${this.mount}: init failed; earlier mounts are applied, and the next push retries`;\n }\n}\n\
|
|
1
|
+
{"version":3,"file":"MountInit.js","names":[],"sources":["../../src/internal/MountInit.ts"],"sourcesContent":["import * as MountSteps from \"@confect/core/MountSteps\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport type * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport { ConvexClient, ConvexFunctionError } from \"../ConvexClient.js\";\nimport { functionsDirectory } from \"./FunctionsDirectory.js\";\n\nexport class MountInitFailed extends Schema.TaggedError<\n MountInitFailed,\n { readonly brand: unique symbol }\n>()(\"MountInitFailed\", { mount: Schema.String, detail: Schema.String }) {\n override get message() {\n return `${this.mount}: init failed; earlier mounts are applied, and the next push retries`;\n }\n}\n\n/**\n * Whether codegen wrote `confectDeploy.ts` into the backend's Convex directory.\n */\nconst hasDeployModule = Effect.fn(\"MountInit.hasDeployModule\")(function* (\n cwd: string,\n) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const functions = yield* functionsDirectory(cwd);\n return yield* fs.exists(path.join(cwd, functions, \"confectDeploy.ts\"));\n});\n\n/**\n * Run every mount's `init` against a pushed deployment, in the order\n * `MountSteps.run` walks them, the order the test backend uses too. The first\n * failing mount stops the run. Each `init` is its own transaction, so earlier\n * mounts stay applied and a rerun converges.\n *\n * @internal\n */\nexport const run = Effect.fn(\"MountInit.run\")(function* (\n url: string,\n key: Redacted.Redacted<string>,\n cwd: string,\n) {\n const failed =\n (mount: string) =>\n (error: { readonly _tag: string }): MountInitFailed =>\n MountInitFailed.make({\n mount,\n detail: Schema.is(ConvexFunctionError)(error)\n ? error.errorMessage\n : error._tag,\n });\n if (\n !(yield* hasDeployModule(cwd).pipe(\n Effect.mapError(failed(MountSteps.STEPS)),\n ))\n )\n return;\n const client = yield* ConvexClient;\n yield* MountSteps.run({\n steps: (prefix) =>\n client\n .runFunction(url, key, MountSteps.STEPS, {}, prefix)\n .pipe(Effect.mapError(failed(prefix ?? MountSteps.STEPS))),\n init: (mount, functionName, args) =>\n client\n .runFunction(url, key, functionName, args, mount)\n .pipe(Effect.mapError(failed(mount))),\n failed: (mount, detail) => MountInitFailed.make({ mount, detail }),\n });\n});\n"],"mappings":";;;;;;;;AASA,IAAa,kBAAb,cAAqC,OAAO,YAG1C,CAAC,CAAC,mBAAmB;CAAE,OAAO,OAAO;CAAQ,QAAQ,OAAO;AAAO,CAAC,CAAC,CAAC;CACtE,IAAa,UAAU;EACrB,OAAO,GAAG,KAAK,MAAM;CACvB;AACF;;;;AAKA,MAAM,kBAAkB,OAAO,GAAG,2BAA2B,CAAC,CAAC,WAC7D,KACA;CACA,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,YAAY,OAAO,mBAAmB,GAAG;CAC/C,OAAO,OAAO,GAAG,OAAO,KAAK,KAAK,KAAK,WAAW,kBAAkB,CAAC;AACvE,CAAC;;;;;;;;;AAUD,MAAa,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,WAC5C,KACA,KACA,KACA;CACA,MAAM,UACH,WACA,UACC,gBAAgB,KAAK;EACnB;EACA,QAAQ,OAAO,GAAG,mBAAmB,CAAC,CAAC,KAAK,IACxC,MAAM,eACN,MAAM;CACZ,CAAC;CACL,IACE,EAAE,OAAO,gBAAgB,GAAG,CAAC,CAAC,KAC5B,OAAO,SAAS,OAAO,WAAW,KAAK,CAAC,CAC1C,IAEA;CACF,MAAM,SAAS,OAAO;CACtB,OAAO,WAAW,IAAI;EACpB,QAAQ,WACN,OACG,YAAY,KAAK,KAAK,WAAW,OAAO,CAAC,GAAG,MAAM,CAAC,CACnD,KAAK,OAAO,SAAS,OAAO,UAAU,WAAW,KAAK,CAAC,CAAC;EAC7D,OAAO,OAAO,cAAc,SAC1B,OACG,YAAY,KAAK,KAAK,cAAc,MAAM,KAAK,CAAC,CAChD,KAAK,OAAO,SAAS,OAAO,KAAK,CAAC,CAAC;EACxC,SAAS,OAAO,WAAW,gBAAgB,KAAK;GAAE;GAAO;EAAO,CAAC;CACnE,CAAC;AACH,CAAC"}
|
|
@@ -9,6 +9,7 @@ import * as Schema from "effect/Schema";
|
|
|
9
9
|
declare const PushLockError_base: Schema.Class<PushLockError, Schema.TaggedStruct<"PushLockError", {
|
|
10
10
|
readonly deploymentName: Schema.String;
|
|
11
11
|
readonly reason: Schema.Literals<readonly ["configuration", "timeout", "filesystem"]>;
|
|
12
|
+
readonly missing: Schema.optionalKey<Schema.Literals<readonly ["PushLock"]>>;
|
|
12
13
|
}>, import("effect/Cause").YieldableError & {
|
|
13
14
|
readonly brand: unique symbol;
|
|
14
15
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushLock.d.ts","sources":["../../src/internal/PushLock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"PushLock.d.ts","sources":["../../src/internal/PushLock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;oBAOpB,OAAO,MAAM;;AAFjC,qBAAa,aAAc,SAAQ,kBAOjC;IACA,IAAa,OAAO,WAWnB;CACF;;uBAUsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACzB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,CAAC;;AAX/C;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,aAQW;CAAG;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,aAAc;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;CAAE,gGA6ClE,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { acquire } from "./FileLock.js";
|
|
2
2
|
import { userCache } from "./UserCache.js";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
4
5
|
import * as FileSystem from "effect/FileSystem";
|
|
5
6
|
import * as Layer from "effect/Layer";
|
|
6
7
|
import * as Path from "effect/Path";
|
|
7
8
|
import * as Context from "effect/Context";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
9
9
|
import * as Option from "effect/Option";
|
|
10
10
|
import * as SecureRandom from "effect/crypto/SecureRandom";
|
|
11
11
|
import * as Duration from "effect/Duration";
|
|
@@ -17,11 +17,12 @@ var PushLockError = class extends Schema.TaggedError()("PushLockError", {
|
|
|
17
17
|
"configuration",
|
|
18
18
|
"timeout",
|
|
19
19
|
"filesystem"
|
|
20
|
-
])
|
|
20
|
+
]),
|
|
21
|
+
missing: Schema.Literals(["PushLock"]).pipe(Schema.optionalKey)
|
|
21
22
|
}) {
|
|
22
23
|
get message() {
|
|
23
24
|
switch (this.reason) {
|
|
24
|
-
case "configuration": return `Push lock for ${this.deploymentName} needs a home directory to keep its lock file in`;
|
|
25
|
+
case "configuration": return this.missing === "PushLock" ? `Push lock for ${this.deploymentName} needs the PushLock service to be provided` : `Push lock for ${this.deploymentName} needs a home directory to keep its lock file in`;
|
|
25
26
|
case "timeout": return `Timed out waiting for another push to ${this.deploymentName} to release its push lock`;
|
|
26
27
|
case "filesystem": return `Push lock for ${this.deploymentName} could not read or write its lock file`;
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushLock.js","names":["FileLock.acquire"],"sources":["../../src/internal/PushLock.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as SecureRandom from \"effect/crypto/SecureRandom\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as FileLock from \"./FileLock.js\";\nimport { userCache } from \"./UserCache.js\";\n\nexport class PushLockError extends Schema.TaggedError<\n PushLockError,\n { readonly brand: unique symbol }\n>()(\"PushLockError\", {\n deploymentName: Schema.String,\n reason: Schema.Literals([\"configuration\", \"timeout\", \"filesystem\"]),\n}) {\n override get message() {\n switch (this.reason) {\n case \"configuration\":\n return `Push lock for ${this.deploymentName} needs a home directory to keep its lock file in`;\n case \"timeout\":\n return `Timed out waiting for another push to ${this.deploymentName} to release its push lock`;\n case \"filesystem\":\n return `Push lock for ${this.deploymentName} could not read or write its lock file`;\n }\n }\n}\n\n/**\n * Serialises pushes per deployment. Overlapping `convex deploy` runs against\n * one deployment race on `wait_for_schema`, so every push holds the lock for\n * its whole duration, whichever stack, checkout, or process it comes from.\n */\nexport class PushLock extends Context.Service<\n PushLock,\n {\n readonly withLock: <A, E, R>(\n deploymentName: string,\n effect: Effect.Effect<A, E, R>,\n ) => Effect.Effect<A, E | PushLockError, R>;\n }\n>()(\"@confect/alchemy/internal/PushLock\") {}\n\n/**\n * One lock file per deployment under the user's cache,\n * `confect/alchemy/locks/<deployment>.lock`, so every checkout on the machine\n * shares it. A lock left by a process that exited is taken over; a holder that\n * never releases ends in a typed timeout.\n *\n * @internal\n */\nexport const layer = (options?: { readonly timeout?: Duration.Input }) =>\n Layer.effect(\n PushLock,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const random = yield* SecureRandom.SecureRandom;\n const timeout = options?.timeout ?? Duration.minutes(10);\n const lock = Effect.fn(\"PushLock.lock\")(\n function* (deploymentName: string, scope: Scope.Scope) {\n const failed = (reason: PushLockError[\"reason\"]) =>\n PushLockError.make({ deploymentName, reason });\n const cache = yield* userCache.pipe(\n Effect.mapError(() => failed(\"configuration\")),\n );\n if (Option.isNone(cache)) return yield* failed(\"configuration\");\n yield* FileLock.acquire(\n path.join(\n cache.value,\n \"confect\",\n \"alchemy\",\n \"locks\",\n `${deploymentName}.lock`,\n ),\n timeout,\n ).pipe(\n Scope.provide(scope),\n Effect.mapError((error) =>\n failed(error.reason === \"timeout\" ? \"timeout\" : \"filesystem\"),\n ),\n );\n },\n Effect.provideService(FileSystem.FileSystem, fs),\n Effect.provideService(Path.Path, path),\n Effect.provideService(SecureRandom.SecureRandom, random),\n );\n return PushLock.of({\n withLock: (deploymentName, effect) =>\n Effect.acquireUseRelease(\n Scope.make(),\n (scope) => lock(deploymentName, scope).pipe(Effect.andThen(effect)),\n (scope, exit) => Scope.close(scope, exit),\n ),\n });\n }),\n );\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,gBAAb,cAAmC,OAAO,YAGxC,CAAC,CAAC,iBAAiB;CACnB,gBAAgB,OAAO;CACvB,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAW;CAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"PushLock.js","names":["FileLock.acquire"],"sources":["../../src/internal/PushLock.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as SecureRandom from \"effect/crypto/SecureRandom\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as FileLock from \"./FileLock.js\";\nimport { userCache } from \"./UserCache.js\";\n\nexport class PushLockError extends Schema.TaggedError<\n PushLockError,\n { readonly brand: unique symbol }\n>()(\"PushLockError\", {\n deploymentName: Schema.String,\n reason: Schema.Literals([\"configuration\", \"timeout\", \"filesystem\"]),\n missing: Schema.Literals([\"PushLock\"]).pipe(Schema.optionalKey),\n}) {\n override get message() {\n switch (this.reason) {\n case \"configuration\":\n return this.missing === \"PushLock\"\n ? `Push lock for ${this.deploymentName} needs the PushLock service to be provided`\n : `Push lock for ${this.deploymentName} needs a home directory to keep its lock file in`;\n case \"timeout\":\n return `Timed out waiting for another push to ${this.deploymentName} to release its push lock`;\n case \"filesystem\":\n return `Push lock for ${this.deploymentName} could not read or write its lock file`;\n }\n }\n}\n\n/**\n * Serialises pushes per deployment. Overlapping `convex deploy` runs against\n * one deployment race on `wait_for_schema`, so every push holds the lock for\n * its whole duration, whichever stack, checkout, or process it comes from.\n */\nexport class PushLock extends Context.Service<\n PushLock,\n {\n readonly withLock: <A, E, R>(\n deploymentName: string,\n effect: Effect.Effect<A, E, R>,\n ) => Effect.Effect<A, E | PushLockError, R>;\n }\n>()(\"@confect/alchemy/internal/PushLock\") {}\n\n/**\n * One lock file per deployment under the user's cache,\n * `confect/alchemy/locks/<deployment>.lock`, so every checkout on the machine\n * shares it. A lock left by a process that exited is taken over; a holder that\n * never releases ends in a typed timeout.\n *\n * @internal\n */\nexport const layer = (options?: { readonly timeout?: Duration.Input }) =>\n Layer.effect(\n PushLock,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const random = yield* SecureRandom.SecureRandom;\n const timeout = options?.timeout ?? Duration.minutes(10);\n const lock = Effect.fn(\"PushLock.lock\")(\n function* (deploymentName: string, scope: Scope.Scope) {\n const failed = (reason: PushLockError[\"reason\"]) =>\n PushLockError.make({ deploymentName, reason });\n const cache = yield* userCache.pipe(\n Effect.mapError(() => failed(\"configuration\")),\n );\n if (Option.isNone(cache)) return yield* failed(\"configuration\");\n yield* FileLock.acquire(\n path.join(\n cache.value,\n \"confect\",\n \"alchemy\",\n \"locks\",\n `${deploymentName}.lock`,\n ),\n timeout,\n ).pipe(\n Scope.provide(scope),\n Effect.mapError((error) =>\n failed(error.reason === \"timeout\" ? \"timeout\" : \"filesystem\"),\n ),\n );\n },\n Effect.provideService(FileSystem.FileSystem, fs),\n Effect.provideService(Path.Path, path),\n Effect.provideService(SecureRandom.SecureRandom, random),\n );\n return PushLock.of({\n withLock: (deploymentName, effect) =>\n Effect.acquireUseRelease(\n Scope.make(),\n (scope) => lock(deploymentName, scope).pipe(Effect.andThen(effect)),\n (scope, exit) => Scope.close(scope, exit),\n ),\n });\n }),\n );\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,gBAAb,cAAmC,OAAO,YAGxC,CAAC,CAAC,iBAAiB;CACnB,gBAAgB,OAAO;CACvB,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAW;CAAY,CAAC;CAClE,SAAS,OAAO,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,WAAW;AAChE,CAAC,CAAC,CAAC;CACD,IAAa,UAAU;EACrB,QAAQ,KAAK,QAAb;GACE,KAAK,iBACH,OAAO,KAAK,YAAY,aACpB,iBAAiB,KAAK,eAAe,8CACrC,iBAAiB,KAAK,eAAe;GAC3C,KAAK,WACH,OAAO,yCAAyC,KAAK,eAAe;GACtE,KAAK,cACH,OAAO,iBAAiB,KAAK,eAAe;EAChD;CACF;AACF;;;;;;AAOA,IAAa,WAAb,cAA8B,QAAQ,QAQpC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC;;;;;;;;;AAU3C,MAAa,SAAS,YACpB,MAAM,OACJ,UACA,OAAO,IAAI,aAAa;CACtB,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,SAAS,OAAO,aAAa;CACnC,MAAM,UAAU,SAAS,WAAW,SAAS,QAAQ,EAAE;CACvD,MAAM,OAAO,OAAO,GAAG,eAAe,CAAC,CACrC,WAAW,gBAAwB,OAAoB;EACrD,MAAM,UAAU,WACd,cAAc,KAAK;GAAE;GAAgB;EAAO,CAAC;EAC/C,MAAM,QAAQ,OAAO,UAAU,KAC7B,OAAO,eAAe,OAAO,eAAe,CAAC,CAC/C;EACA,IAAI,OAAO,OAAO,KAAK,GAAG,OAAO,OAAO,OAAO,eAAe;EAC9D,OAAOA,QACL,KAAK,KACH,MAAM,OACN,WACA,WACA,SACA,GAAG,eAAe,MACpB,GACA,OACF,CAAC,CAAC,KACA,MAAM,QAAQ,KAAK,GACnB,OAAO,UAAU,UACf,OAAO,MAAM,WAAW,YAAY,YAAY,YAAY,CAC9D,CACF;CACF,GACA,OAAO,eAAe,WAAW,YAAY,EAAE,GAC/C,OAAO,eAAe,KAAK,MAAM,IAAI,GACrC,OAAO,eAAe,aAAa,cAAc,MAAM,CACzD;CACA,OAAO,SAAS,GAAG,EACjB,WAAW,gBAAgB,WACzB,OAAO,kBACL,MAAM,KAAK,IACV,UAAU,KAAK,gBAAgB,KAAK,CAAC,CAAC,KAAK,OAAO,QAAQ,MAAM,CAAC,IACjE,OAAO,SAAS,MAAM,MAAM,OAAO,IAAI,CAC1C,EACJ,CAAC;AACH,CAAC,CACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as Arr from "effect/Array";
|
|
1
2
|
import * as Effect from "effect/Effect";
|
|
2
3
|
import * as String from "effect/String";
|
|
3
4
|
import { pipe } from "effect/Function";
|
|
4
|
-
import * as Arr from "effect/Array";
|
|
5
5
|
// src/internal/ResourceIdentity.ts
|
|
6
6
|
const resourceName = Effect.fn("ResourceIdentity.name")(function* (kind, fqn, instanceId) {
|
|
7
7
|
const hash = yield* Effect.promise(() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(`${fqn}:${instanceId}`)));
|
package/dist/internal/Zip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as FileSystem from "effect/FileSystem";
|
|
3
2
|
import * as Schema from "effect/Schema";
|
|
4
3
|
import * as Result from "effect/Result";
|
|
4
|
+
import * as FileSystem from "effect/FileSystem";
|
|
5
5
|
import { inflateRaw } from "node:zlib";
|
|
6
6
|
// src/internal/Zip.ts
|
|
7
7
|
var ZipError = class extends Schema.TaggedError()("ZipError", { reason: Schema.Literals([
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaganref/confect-alchemy",
|
|
3
|
-
"version": "10.6.0-fork.
|
|
3
|
+
"version": "10.6.0-fork.31",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@convex-dev/platform": "^0.1.10"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@confect/cli": "npm:@gaganref/confect-cli@10.6.0-fork.
|
|
9
|
-
"@confect/core": "npm:@gaganref/confect-core@10.6.0-fork.
|
|
10
|
-
"alchemy": "2.0.0-beta.
|
|
8
|
+
"@confect/cli": "npm:@gaganref/confect-cli@10.6.0-fork.31",
|
|
9
|
+
"@confect/core": "npm:@gaganref/confect-core@10.6.0-fork.31",
|
|
10
|
+
"alchemy": ">=2.0.0-beta.85 <2.0.0",
|
|
11
11
|
"convex": "^1.32.0",
|
|
12
12
|
"effect": "~4.1.4"
|
|
13
13
|
},
|