deepline 0.2.48 → 0.2.50
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/bundling-sources/sdk/src/client.ts +15 -3
- package/dist/bundling-sources/sdk/src/play.ts +15 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +89 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +35 -7
- package/dist/bundling-sources/shared_libs/plays/enrich-compat-adapter.ts +21 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +1555 -0
- package/dist/bundling-sources/shared_libs/plays/user-code-safety.ts +61 -0
- package/dist/cli/index.js +147 -15
- package/dist/cli/index.mjs +150 -16
- package/dist/{compiler-manifest-CGZadg-v.d.mts → compiler-manifest-BPA3r-VG.d.mts} +84 -0
- package/dist/{compiler-manifest-CGZadg-v.d.ts → compiler-manifest-BPA3r-VG.d.ts} +84 -0
- package/dist/index.d.mts +27 -6
- package/dist/index.d.ts +27 -6
- package/dist/index.js +10 -4
- package/dist/index.mjs +10 -4
- package/dist/install-integrity.json +5 -2
- package/dist/plays/bundle-play-file.d.mts +4 -2
- package/dist/plays/bundle-play-file.d.ts +4 -2
- package/dist/plays/bundle-play-file.mjs +102 -7
- package/package.json +1 -1
|
@@ -21,7 +21,9 @@ import {
|
|
|
21
21
|
extname,
|
|
22
22
|
isAbsolute,
|
|
23
23
|
join,
|
|
24
|
-
|
|
24
|
+
relative,
|
|
25
|
+
resolve,
|
|
26
|
+
sep
|
|
25
27
|
} from "path";
|
|
26
28
|
import { builtinModules } from "module";
|
|
27
29
|
import { Parser } from "acorn";
|
|
@@ -2806,6 +2808,76 @@ var PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
2806
2808
|
description: "HTTP header containing the webhook signature.",
|
|
2807
2809
|
errorMessage: "bindings.webhook.hmac.header must be a non-empty static string."
|
|
2808
2810
|
},
|
|
2811
|
+
"bindings.webhook.auth.type": {
|
|
2812
|
+
schema: Type.Literal("standard-webhooks"),
|
|
2813
|
+
fixtures: {
|
|
2814
|
+
valid: "standard-webhooks",
|
|
2815
|
+
invalid: "svix",
|
|
2816
|
+
absent: void 0,
|
|
2817
|
+
unresolved: { expression: "type" },
|
|
2818
|
+
edition1: void 0
|
|
2819
|
+
},
|
|
2820
|
+
referenceType: "'standard-webhooks'",
|
|
2821
|
+
// auth itself is optional; once present, the AST adapter requires this
|
|
2822
|
+
// field together with headerFamily and signingSecrets.
|
|
2823
|
+
required: false,
|
|
2824
|
+
resolution: "static-required",
|
|
2825
|
+
issueCode: "play_authoring_standard_webhooks_invalid",
|
|
2826
|
+
description: "Uses the Standard Webhooks v1 symmetric signing scheme.",
|
|
2827
|
+
errorMessage: 'bindings.webhook.auth.type must be the static literal "standard-webhooks".'
|
|
2828
|
+
},
|
|
2829
|
+
"bindings.webhook.auth.headerFamily": {
|
|
2830
|
+
schema: Type.Union([Type.Literal("standard"), Type.Literal("svix")]),
|
|
2831
|
+
fixtures: {
|
|
2832
|
+
valid: "svix",
|
|
2833
|
+
invalid: "webhook",
|
|
2834
|
+
absent: void 0,
|
|
2835
|
+
unresolved: { expression: "headerFamily" },
|
|
2836
|
+
edition1: void 0
|
|
2837
|
+
},
|
|
2838
|
+
referenceType: "'standard' | 'svix'",
|
|
2839
|
+
// auth itself is optional; once present, the AST adapter requires this
|
|
2840
|
+
// field together with type and signingSecrets.
|
|
2841
|
+
required: false,
|
|
2842
|
+
resolution: "static-required",
|
|
2843
|
+
issueCode: "play_authoring_standard_webhooks_invalid",
|
|
2844
|
+
description: "Header namespace expected from the webhook provider.",
|
|
2845
|
+
errorMessage: 'bindings.webhook.auth.headerFamily must be the static literal "standard" or "svix".'
|
|
2846
|
+
},
|
|
2847
|
+
"bindings.webhook.auth.signingSecrets[]": {
|
|
2848
|
+
schema: SecretEnvironmentNameSchema,
|
|
2849
|
+
fixtures: {
|
|
2850
|
+
valid: "VECTOR_WEBHOOK_SECRET",
|
|
2851
|
+
invalid: "vector_webhook_secret",
|
|
2852
|
+
absent: void 0,
|
|
2853
|
+
unresolved: { expression: "secret" },
|
|
2854
|
+
edition1: void 0
|
|
2855
|
+
},
|
|
2856
|
+
referenceType: "string",
|
|
2857
|
+
// auth itself is optional; once present, the AST adapter requires this
|
|
2858
|
+
// field together with type and headerFamily.
|
|
2859
|
+
required: false,
|
|
2860
|
+
resolution: "static-required",
|
|
2861
|
+
issueCode: "play_authoring_standard_webhooks_invalid",
|
|
2862
|
+
description: "Deepline Secret name used to verify Standard Webhooks.",
|
|
2863
|
+
errorMessage: "bindings.webhook.auth.signingSecrets entries must be uppercase Deepline Secret names beginning with a letter."
|
|
2864
|
+
},
|
|
2865
|
+
"bindings.webhook.auth.toleranceSeconds": {
|
|
2866
|
+
schema: Type.Integer({ minimum: 1, maximum: 3600 }),
|
|
2867
|
+
fixtures: {
|
|
2868
|
+
valid: 300,
|
|
2869
|
+
invalid: 0,
|
|
2870
|
+
absent: void 0,
|
|
2871
|
+
unresolved: { expression: "toleranceSeconds" },
|
|
2872
|
+
edition1: void 0
|
|
2873
|
+
},
|
|
2874
|
+
referenceType: "number",
|
|
2875
|
+
required: false,
|
|
2876
|
+
resolution: "static-required",
|
|
2877
|
+
issueCode: "play_authoring_standard_webhooks_invalid",
|
|
2878
|
+
description: "Accepted delivery timestamp skew in seconds, from 1 through 3600.",
|
|
2879
|
+
errorMessage: "bindings.webhook.auth.toleranceSeconds must be a static whole number from 1 through 3600."
|
|
2880
|
+
},
|
|
2809
2881
|
"bindings.cron.schedule": {
|
|
2810
2882
|
schema: Type.String({ minLength: 1 }),
|
|
2811
2883
|
fixtures: {
|
|
@@ -3830,7 +3902,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
3830
3902
|
` inline?: ${cloudReferenceType("inline")};`,
|
|
3831
3903
|
` billing?: { maxCreditsPerRun?: ${cloudReferenceType("billing.maxCreditsPerRun")} };`,
|
|
3832
3904
|
` runtime?: { timeout?: ${cloudReferenceType("runtime.timeout")}; size?: ${cloudReferenceType("runtime.size")} };`,
|
|
3833
|
-
` webhook?: { hmac?: { algorithm?: ${cloudReferenceType("bindings.webhook.hmac.algorithm")}; header?: ${cloudReferenceType("bindings.webhook.hmac.header")}; secretEnv: ${cloudReferenceType("bindings.webhook.hmac.secretEnv")} } };`,
|
|
3905
|
+
` webhook?: { hmac?: { algorithm?: ${cloudReferenceType("bindings.webhook.hmac.algorithm")}; header?: ${cloudReferenceType("bindings.webhook.hmac.header")}; secretEnv: ${cloudReferenceType("bindings.webhook.hmac.secretEnv")} }; auth?: { type: ${cloudReferenceType("bindings.webhook.auth.type")}; headerFamily: ${cloudReferenceType("bindings.webhook.auth.headerFamily")}; signingSecrets: readonly ${cloudReferenceType("bindings.webhook.auth.signingSecrets[]")}[]; toleranceSeconds?: ${cloudReferenceType("bindings.webhook.auth.toleranceSeconds")} } };`,
|
|
3834
3906
|
` cron?: { schedule: ${cloudReferenceType("bindings.cron.schedule")}; timezone?: ${cloudReferenceType("bindings.cron.timezone")} };`,
|
|
3835
3907
|
" sqlListeners?: readonly SqlListenerDeclaration[];",
|
|
3836
3908
|
` secrets?: readonly ${cloudReferenceType("bindings.secrets[]")}[];`,
|
|
@@ -3990,6 +4062,15 @@ function assertValidExportName(exportName) {
|
|
|
3990
4062
|
function sha256(value) {
|
|
3991
4063
|
return createHash("sha256").update(value).digest("hex");
|
|
3992
4064
|
}
|
|
4065
|
+
function sourceIdentityPath(filePath, adapter) {
|
|
4066
|
+
if (!adapter.sourceIdentityRoot) return filePath;
|
|
4067
|
+
const identityRoot = resolve(adapter.sourceIdentityRoot);
|
|
4068
|
+
const logicalPath = relative(identityRoot, resolve(filePath));
|
|
4069
|
+
if (!logicalPath || logicalPath === ".." || logicalPath.startsWith(`..${sep}`) || isAbsolute(logicalPath)) {
|
|
4070
|
+
return filePath;
|
|
4071
|
+
}
|
|
4072
|
+
return logicalPath.split(/[\\/]+/).join("/");
|
|
4073
|
+
}
|
|
3993
4074
|
function formatEsbuildMessage(message) {
|
|
3994
4075
|
const location = message.location ? `${message.location.file}:${message.location.line}:${message.location.column}` : null;
|
|
3995
4076
|
return location ? `${location} ${message.text}` : message.text;
|
|
@@ -4910,12 +4991,15 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
4910
4991
|
const sourceHash = sha256(sourceCode);
|
|
4911
4992
|
const graphHash = sha256(
|
|
4912
4993
|
JSON.stringify({
|
|
4913
|
-
entryFile: absoluteEntryFile,
|
|
4914
|
-
localFiles: [...localFiles.entries()].map(([filePath, contents]) => ({
|
|
4994
|
+
entryFile: sourceIdentityPath(absoluteEntryFile, adapter),
|
|
4995
|
+
localFiles: [...localFiles.entries()].map(([filePath, contents]) => ({
|
|
4996
|
+
filePath: sourceIdentityPath(filePath, adapter),
|
|
4997
|
+
hash: sha256(contents)
|
|
4998
|
+
})).sort((left, right) => left.filePath.localeCompare(right.filePath)),
|
|
4915
4999
|
nodeBuiltins: [...nodeBuiltins].sort(),
|
|
4916
5000
|
packages: [...packages.entries()].map(([name, version]) => ({ name, version })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
4917
5001
|
importedPlayDependencies: [...importedPlayDependencies.values()].map((dependency) => ({
|
|
4918
|
-
filePath: dependency.filePath,
|
|
5002
|
+
filePath: sourceIdentityPath(dependency.filePath, adapter),
|
|
4919
5003
|
playName: dependency.playName
|
|
4920
5004
|
})).sort((left, right) => left.filePath.localeCompare(right.filePath))
|
|
4921
5005
|
})
|
|
@@ -4954,6 +5038,7 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
4954
5038
|
}
|
|
4955
5039
|
function artifactCachePath(graphHash, artifactKind, adapter) {
|
|
4956
5040
|
return join(
|
|
5041
|
+
/* turbopackIgnore: true */
|
|
4957
5042
|
adapter.cacheDir ?? PLAY_ARTIFACT_CACHE_DIR,
|
|
4958
5043
|
`${graphHash}.${artifactKind}.json`
|
|
4959
5044
|
);
|
|
@@ -4961,7 +5046,12 @@ function artifactCachePath(graphHash, artifactKind, adapter) {
|
|
|
4961
5046
|
async function readArtifactCache(graphHash, artifactKind, adapter) {
|
|
4962
5047
|
try {
|
|
4963
5048
|
const serialized = await readFile(
|
|
4964
|
-
|
|
5049
|
+
/* turbopackIgnore: true */
|
|
5050
|
+
artifactCachePath(
|
|
5051
|
+
graphHash,
|
|
5052
|
+
artifactKind,
|
|
5053
|
+
adapter
|
|
5054
|
+
),
|
|
4965
5055
|
"utf-8"
|
|
4966
5056
|
);
|
|
4967
5057
|
return JSON.parse(serialized);
|
|
@@ -4971,8 +5061,13 @@ async function readArtifactCache(graphHash, artifactKind, adapter) {
|
|
|
4971
5061
|
}
|
|
4972
5062
|
async function writeArtifactCache(artifact, adapter) {
|
|
4973
5063
|
const cacheDir = adapter.cacheDir ?? PLAY_ARTIFACT_CACHE_DIR;
|
|
4974
|
-
await mkdir(
|
|
5064
|
+
await mkdir(
|
|
5065
|
+
/* turbopackIgnore: true */
|
|
5066
|
+
cacheDir,
|
|
5067
|
+
{ recursive: true }
|
|
5068
|
+
);
|
|
4975
5069
|
await writeFile(
|
|
5070
|
+
/* turbopackIgnore: true */
|
|
4976
5071
|
artifactCachePath(
|
|
4977
5072
|
artifact.graphHash,
|
|
4978
5073
|
artifact.artifactKind ?? PLAY_ARTIFACT_KINDS.cjsNode20,
|