modal 0.10.2-dev.8 → 0.10.2-dev.9
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/index.cjs +39 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +39 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -68869,6 +68869,41 @@ function isSet6(value) {
|
|
|
68869
68869
|
var import_promises = require("timers/promises");
|
|
68870
68870
|
var import_nice_grpc7 = require("nice-grpc");
|
|
68871
68871
|
|
|
68872
|
+
// src/server_warnings.ts
|
|
68873
|
+
var SERVER_WARNING_HEADER = "x-modal-warning";
|
|
68874
|
+
var SERVER_WARNING_REGISTRY_LIMIT = 2048;
|
|
68875
|
+
function logServerWarnings(logger2, trailer, seen) {
|
|
68876
|
+
const joined = trailer.get(SERVER_WARNING_HEADER);
|
|
68877
|
+
if (typeof joined !== "string") return;
|
|
68878
|
+
for (const encoded of joined.split(",")) {
|
|
68879
|
+
let message;
|
|
68880
|
+
try {
|
|
68881
|
+
message = decodeURIComponent(encoded.trim());
|
|
68882
|
+
} catch {
|
|
68883
|
+
message = encoded.trim();
|
|
68884
|
+
}
|
|
68885
|
+
if (seen.size > SERVER_WARNING_REGISTRY_LIMIT) {
|
|
68886
|
+
seen.clear();
|
|
68887
|
+
}
|
|
68888
|
+
if (seen.has(message)) continue;
|
|
68889
|
+
seen.add(message);
|
|
68890
|
+
logger2.warn(message);
|
|
68891
|
+
}
|
|
68892
|
+
}
|
|
68893
|
+
function serverWarningMiddleware(logger2) {
|
|
68894
|
+
const seen = /* @__PURE__ */ new Set();
|
|
68895
|
+
return async function* serverWarningMiddleware2(call, options) {
|
|
68896
|
+
const { onTrailer, ...restOptions } = options;
|
|
68897
|
+
return yield* call.next(call.request, {
|
|
68898
|
+
...restOptions,
|
|
68899
|
+
onTrailer: (trailer) => {
|
|
68900
|
+
logServerWarnings(logger2, trailer, seen);
|
|
68901
|
+
onTrailer?.(trailer);
|
|
68902
|
+
}
|
|
68903
|
+
});
|
|
68904
|
+
};
|
|
68905
|
+
}
|
|
68906
|
+
|
|
68872
68907
|
// src/config.ts
|
|
68873
68908
|
var import_node_console = require("console");
|
|
68874
68909
|
var import_node_fs = require("fs");
|
|
@@ -68960,7 +68995,7 @@ function getProfile(profileName) {
|
|
|
68960
68995
|
const ms = Math.round(parsed * 1e3);
|
|
68961
68996
|
return parsed > 0 && ms === 0 ? 1 : ms;
|
|
68962
68997
|
})(),
|
|
68963
|
-
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : parseBooleanFlag(profileData.sandbox_v2)
|
|
68998
|
+
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : profileData.sandbox_v2 !== void 0 ? parseBooleanFlag(profileData.sandbox_v2) : true
|
|
68964
68999
|
};
|
|
68965
69000
|
return profile;
|
|
68966
69001
|
}
|
|
@@ -69182,7 +69217,7 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
69182
69217
|
options.metadata ??= new import_nice_grpc7.Metadata();
|
|
69183
69218
|
options.metadata.set("authorization", `Bearer ${self.jwt}`);
|
|
69184
69219
|
return yield* call.next(call.request, options);
|
|
69185
|
-
});
|
|
69220
|
+
}).use(serverWarningMiddleware(logger2));
|
|
69186
69221
|
this.factory = factory;
|
|
69187
69222
|
this.stub = factory.create(TaskCommandRouterDefinition, this.channel);
|
|
69188
69223
|
this.armIdleTimer();
|
|
@@ -73700,7 +73735,7 @@ var AuthTokenManager = class {
|
|
|
73700
73735
|
};
|
|
73701
73736
|
|
|
73702
73737
|
// src/version.ts
|
|
73703
|
-
var SDK_VERSION = "0.10.2-dev.
|
|
73738
|
+
var SDK_VERSION = "0.10.2-dev.9";
|
|
73704
73739
|
function getSDKVersion() {
|
|
73705
73740
|
return SDK_VERSION;
|
|
73706
73741
|
}
|
|
@@ -73967,7 +74002,7 @@ var ModalClient = class {
|
|
|
73967
74002
|
"grpc.keepalive_timeout_ms": 1e4,
|
|
73968
74003
|
"grpc.keepalive_permit_without_calls": 1
|
|
73969
74004
|
});
|
|
73970
|
-
let factory = (0, import_nice_grpc14.createClientFactory)().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(timeoutMiddleware);
|
|
74005
|
+
let factory = (0, import_nice_grpc14.createClientFactory)().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(serverWarningMiddleware(this.logger)).use(timeoutMiddleware);
|
|
73971
74006
|
for (const middleware of this.customMiddleware) {
|
|
73972
74007
|
factory = factory.use(middleware);
|
|
73973
74008
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -5034,7 +5034,7 @@ interface WorkspaceBillingSummaryResponse {
|
|
|
5034
5034
|
meteredCostBreakdown: {
|
|
5035
5035
|
[key: string]: string;
|
|
5036
5036
|
};
|
|
5037
|
-
/** keyed by plan, credits, reservations, storage */
|
|
5037
|
+
/** keyed by plan, credits, reservations, storage, network egress allowance */
|
|
5038
5038
|
adjustments: {
|
|
5039
5039
|
[key: string]: string;
|
|
5040
5040
|
};
|
|
@@ -8522,7 +8522,7 @@ interface Profile {
|
|
|
8522
8522
|
sandboxChannelIdleTimeoutMs: number;
|
|
8523
8523
|
/**
|
|
8524
8524
|
* Set by the MODAL_SANDBOX_V2 environment variable or the sandbox_v2
|
|
8525
|
-
* profile key in .modal.toml.
|
|
8525
|
+
* profile key in .modal.toml. Defaults to true when neither is set.
|
|
8526
8526
|
*/
|
|
8527
8527
|
sandboxV2: boolean;
|
|
8528
8528
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5034,7 +5034,7 @@ interface WorkspaceBillingSummaryResponse {
|
|
|
5034
5034
|
meteredCostBreakdown: {
|
|
5035
5035
|
[key: string]: string;
|
|
5036
5036
|
};
|
|
5037
|
-
/** keyed by plan, credits, reservations, storage */
|
|
5037
|
+
/** keyed by plan, credits, reservations, storage, network egress allowance */
|
|
5038
5038
|
adjustments: {
|
|
5039
5039
|
[key: string]: string;
|
|
5040
5040
|
};
|
|
@@ -8522,7 +8522,7 @@ interface Profile {
|
|
|
8522
8522
|
sandboxChannelIdleTimeoutMs: number;
|
|
8523
8523
|
/**
|
|
8524
8524
|
* Set by the MODAL_SANDBOX_V2 environment variable or the sandbox_v2
|
|
8525
|
-
* profile key in .modal.toml.
|
|
8525
|
+
* profile key in .modal.toml. Defaults to true when neither is set.
|
|
8526
8526
|
*/
|
|
8527
8527
|
sandboxV2: boolean;
|
|
8528
8528
|
}
|
package/dist/index.js
CHANGED
|
@@ -68788,6 +68788,41 @@ import {
|
|
|
68788
68788
|
Status as Status6
|
|
68789
68789
|
} from "nice-grpc";
|
|
68790
68790
|
|
|
68791
|
+
// src/server_warnings.ts
|
|
68792
|
+
var SERVER_WARNING_HEADER = "x-modal-warning";
|
|
68793
|
+
var SERVER_WARNING_REGISTRY_LIMIT = 2048;
|
|
68794
|
+
function logServerWarnings(logger2, trailer, seen) {
|
|
68795
|
+
const joined = trailer.get(SERVER_WARNING_HEADER);
|
|
68796
|
+
if (typeof joined !== "string") return;
|
|
68797
|
+
for (const encoded of joined.split(",")) {
|
|
68798
|
+
let message;
|
|
68799
|
+
try {
|
|
68800
|
+
message = decodeURIComponent(encoded.trim());
|
|
68801
|
+
} catch {
|
|
68802
|
+
message = encoded.trim();
|
|
68803
|
+
}
|
|
68804
|
+
if (seen.size > SERVER_WARNING_REGISTRY_LIMIT) {
|
|
68805
|
+
seen.clear();
|
|
68806
|
+
}
|
|
68807
|
+
if (seen.has(message)) continue;
|
|
68808
|
+
seen.add(message);
|
|
68809
|
+
logger2.warn(message);
|
|
68810
|
+
}
|
|
68811
|
+
}
|
|
68812
|
+
function serverWarningMiddleware(logger2) {
|
|
68813
|
+
const seen = /* @__PURE__ */ new Set();
|
|
68814
|
+
return async function* serverWarningMiddleware2(call, options) {
|
|
68815
|
+
const { onTrailer, ...restOptions } = options;
|
|
68816
|
+
return yield* call.next(call.request, {
|
|
68817
|
+
...restOptions,
|
|
68818
|
+
onTrailer: (trailer) => {
|
|
68819
|
+
logServerWarnings(logger2, trailer, seen);
|
|
68820
|
+
onTrailer?.(trailer);
|
|
68821
|
+
}
|
|
68822
|
+
});
|
|
68823
|
+
};
|
|
68824
|
+
}
|
|
68825
|
+
|
|
68791
68826
|
// src/config.ts
|
|
68792
68827
|
import { warn } from "node:console";
|
|
68793
68828
|
import { readFileSync } from "node:fs";
|
|
@@ -68879,7 +68914,7 @@ function getProfile(profileName) {
|
|
|
68879
68914
|
const ms = Math.round(parsed * 1e3);
|
|
68880
68915
|
return parsed > 0 && ms === 0 ? 1 : ms;
|
|
68881
68916
|
})(),
|
|
68882
|
-
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : parseBooleanFlag(profileData.sandbox_v2)
|
|
68917
|
+
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : profileData.sandbox_v2 !== void 0 ? parseBooleanFlag(profileData.sandbox_v2) : true
|
|
68883
68918
|
};
|
|
68884
68919
|
return profile;
|
|
68885
68920
|
}
|
|
@@ -69101,7 +69136,7 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
69101
69136
|
options.metadata ??= new Metadata();
|
|
69102
69137
|
options.metadata.set("authorization", `Bearer ${self.jwt}`);
|
|
69103
69138
|
return yield* call.next(call.request, options);
|
|
69104
|
-
});
|
|
69139
|
+
}).use(serverWarningMiddleware(logger2));
|
|
69105
69140
|
this.factory = factory;
|
|
69106
69141
|
this.stub = factory.create(TaskCommandRouterDefinition, this.channel);
|
|
69107
69142
|
this.armIdleTimer();
|
|
@@ -73619,7 +73654,7 @@ var AuthTokenManager = class {
|
|
|
73619
73654
|
};
|
|
73620
73655
|
|
|
73621
73656
|
// src/version.ts
|
|
73622
|
-
var SDK_VERSION = "0.10.2-dev.
|
|
73657
|
+
var SDK_VERSION = "0.10.2-dev.9";
|
|
73623
73658
|
function getSDKVersion() {
|
|
73624
73659
|
return SDK_VERSION;
|
|
73625
73660
|
}
|
|
@@ -73891,7 +73926,7 @@ var ModalClient = class {
|
|
|
73891
73926
|
"grpc.keepalive_timeout_ms": 1e4,
|
|
73892
73927
|
"grpc.keepalive_permit_without_calls": 1
|
|
73893
73928
|
});
|
|
73894
|
-
let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(timeoutMiddleware);
|
|
73929
|
+
let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(serverWarningMiddleware(this.logger)).use(timeoutMiddleware);
|
|
73895
73930
|
for (const middleware of this.customMiddleware) {
|
|
73896
73931
|
factory = factory.use(middleware);
|
|
73897
73932
|
}
|