@prisma/composer-prisma-cloud 0.11.0-dev.3 → 0.11.0-dev.5
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/auth/pack.mjs +1 -1
- package/dist/auth/pack.mjs.map +1 -1
- package/dist/auth/testing.mjs +1 -1
- package/dist/auth/testing.mjs.map +1 -1
- package/dist/control.d.mts +0 -9
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +105 -88
- package/dist/control.mjs.map +1 -1
- package/dist/local-target.mjs +46 -34
- package/dist/local-target.mjs.map +1 -1
- package/dist/{s3-credentials-resource-BUsjCFtj-C-nS9rK-.mjs → s3-credentials-resource-BUsjCFtj-BzHGBAmT.mjs} +18 -165
- package/dist/{s3-credentials-resource-BUsjCFtj-C-nS9rK-.mjs.map → s3-credentials-resource-BUsjCFtj-BzHGBAmT.mjs.map} +1 -1
- package/package.json +23 -23
package/dist/control.d.mts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { t as ProviderParamEntry } from "./serializer-BD_6nkr4-DWn5NNTC.mjs";
|
|
2
|
-
import "effect/Context";
|
|
3
|
-
import "effect/Effect";
|
|
4
|
-
import "effect/Layer";
|
|
5
|
-
import "effect/Config";
|
|
6
|
-
import { createManagementApiClient } from "@prisma/management-api-sdk";
|
|
7
|
-
import "effect/Redacted";
|
|
8
|
-
import "alchemy/Provider";
|
|
9
|
-
import { Resource } from "alchemy";
|
|
10
2
|
import * as Output from "alchemy/Output";
|
|
11
3
|
import * as AlchemyPrisma from "alchemy/Prisma";
|
|
12
|
-
import { EnvironmentVariable } from "alchemy/Prisma";
|
|
13
4
|
import { ExtensionDescriptor, StateDescriptor } from "@prisma/composer/config";
|
|
14
5
|
//#region ../../1-prisma-cloud/1-extensions/target/dist/control.d.mts
|
|
15
6
|
//#region src/descriptors/shared.d.ts
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/control.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAoBU,sBAAsB;;;;;;;;WAQrB,QAAQ,6BAA6B,OAAO;;;;;;;;UAQ7C;WACC,gBAAgB,OAAO;;;;;;;;;;;;UAYxB,6BAA6B;WAC5B,kBAAkB,aAAa,8BAA8B,oBAAoB,OAAO;;;;;cAKrF,mBAAmB;UACvB;;EAER;;EAEA,SAAS,cAAc,MAAM;;;;;;;;KAQ1B,qBAAqB,KAAK,0BAA0B,KAAK;;;;;;;;;;iBAU7C,oBAAoB,kBAAkB,sBAAsB,QAAQ,oBAAoB,sBAAsB,oBAAoB,gBAAgB;cACrJ,iBAAiB,oBAAoB,gBAAgB;;cAErD,cAAc,OAAO,uBAAuB"}
|
package/dist/control.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { o as paramBindingFor, s as paramName } from "./secret-Dgyg1WyG-Dzz95fGI
|
|
|
2
2
|
import { a as encode, c as paramEntries, d as serializeInput, n as configKey, o as encodeParamPointer, r as decodeParamPointer, s as isParamPointerRow } from "./serializer-DTCrRl7S-CN0q1ZFB.mjs";
|
|
3
3
|
import { a as provisionedEdges, n as SELF_ORIGIN, r as STREAMS_API_KEY, t as RESERVED_PROVIDER_PARAMS } from "./provisioned-edges-DKsBi7uK-BmsYKWZI.mjs";
|
|
4
4
|
import { n as requiredPackHeadOf } from "./required-pack-head-BrrJarzc-DeP50pBu.mjs";
|
|
5
|
-
import { A as
|
|
5
|
+
import { A as collectPages, C as appAfterEnvironment, D as RESERVED_DATABASE_URL_KEYS, E as PrismaApiError, F as fromEnv, I as managementApiBaseUrl, M as layer, N as resolveDefaultBranchId, O as call, P as PrismaCredentials, S as ServiceKeyProvider, T as ManagementClient, _ as resolveTargetRef, a as PgWarmProvider, b as providers, d as collectPreflightNames, f as containerDescriptor, g as resolvePrismaNextConfig, h as prismaCloudContainerOf, i as PgWarm, j as drivePagesAsync, k as claimDatabaseUrlKeys, l as S3Credentials, m as packHeadRefHashes, n as GeneratedParamProvider, o as PnMigration, r as PRISMA_CLOUD_EXTENSION_ID, s as PnMigrationProvider, t as GeneratedParam, u as S3CredentialsProvider, w as isWithin, x as ServiceKey } from "./s3-credentials-resource-BUsjCFtj-BzHGBAmT.mjs";
|
|
6
6
|
import { n as isPnPostgresResourceNode } from "./prisma-next-hB3CQxKI-BYVc-k-F.mjs";
|
|
7
7
|
import { isParamSource } from "@prisma/composer";
|
|
8
8
|
import { blindCast } from "@prisma/composer/casts";
|
|
@@ -12,7 +12,6 @@ import * as Layer from "effect/Layer";
|
|
|
12
12
|
import { createManagementApiClient } from "@prisma/management-api-sdk";
|
|
13
13
|
import * as Redacted from "effect/Redacted";
|
|
14
14
|
import * as Data from "effect/Data";
|
|
15
|
-
import { Stack } from "alchemy";
|
|
16
15
|
import * as crypto from "node:crypto";
|
|
17
16
|
import { createHash } from "node:crypto";
|
|
18
17
|
import * as fs$1 from "node:fs";
|
|
@@ -20,7 +19,8 @@ import * as os$1 from "node:os";
|
|
|
20
19
|
import * as path$1 from "node:path";
|
|
21
20
|
import * as zlib from "node:zlib";
|
|
22
21
|
import * as Output from "alchemy/Output";
|
|
23
|
-
import
|
|
22
|
+
import { Stack } from "alchemy";
|
|
23
|
+
import * as Prisma$1 from "alchemy/Prisma";
|
|
24
24
|
import { State, makeHttpStateStore } from "alchemy/State";
|
|
25
25
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
26
26
|
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
@@ -286,7 +286,7 @@ await main.run(boot.address, () => import(boot.appEntrypoint));
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
//#endregion
|
|
289
|
-
//#region ../../1-prisma-cloud/0-lowering/lowering/dist/resources-
|
|
289
|
+
//#region ../../1-prisma-cloud/0-lowering/lowering/dist/resources-CXUKkcyA.mjs
|
|
290
290
|
/**
|
|
291
291
|
* Reporting is observability, so no call may stall the deploy: every request
|
|
292
292
|
* carries this deadline, and an expired one is warned and dropped like any
|
|
@@ -349,12 +349,14 @@ function buildsApi(options) {
|
|
|
349
349
|
/** Names the build a run belongs to. Set by the CLI on the alchemy child, or by a CI runner that created the build itself. */
|
|
350
350
|
const BUILD_ID_ENV = "PRISMA_BUILD_ID";
|
|
351
351
|
/**
|
|
352
|
-
* Alchemy resource type → platform resource type
|
|
352
|
+
* Alchemy resource type → platform resource type, keyed by upstream
|
|
353
|
+
* `alchemy/Prisma`'s type-ids and attribute names — the shapes the state
|
|
354
|
+
* store actually writes since the upstream provider adoption.
|
|
353
355
|
*
|
|
354
|
-
* Two
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
356
|
+
* Two resources are deliberately absent. `Prisma.BucketAccessKey` has no
|
|
357
|
+
* platform resource type to map onto. `PrismaCloud.ServiceKey` is a value
|
|
358
|
+
* this deploy mints locally, not a platform resource at all — the platform's
|
|
359
|
+
* `service_key` is what `Prisma.Connection` creates.
|
|
358
360
|
*
|
|
359
361
|
* Anything not listed — `PgWarm`, and every resource another extension
|
|
360
362
|
* contributes — is not a Prisma Cloud resource and is not reported.
|
|
@@ -362,23 +364,23 @@ const BUILD_ID_ENV = "PRISMA_BUILD_ID";
|
|
|
362
364
|
const PLATFORM_RESOURCES = {
|
|
363
365
|
"Prisma.Project": {
|
|
364
366
|
type: "project",
|
|
365
|
-
idField: "
|
|
367
|
+
idField: "projectId"
|
|
366
368
|
},
|
|
367
369
|
"Prisma.Database": {
|
|
368
370
|
type: "database",
|
|
369
|
-
idField: "
|
|
371
|
+
idField: "databaseId"
|
|
370
372
|
},
|
|
371
373
|
"Prisma.Connection": {
|
|
372
374
|
type: "service_key",
|
|
373
|
-
idField: "
|
|
375
|
+
idField: "connectionId"
|
|
374
376
|
},
|
|
375
377
|
"Prisma.Bucket": {
|
|
376
378
|
type: "bucket",
|
|
377
|
-
idField: "
|
|
379
|
+
idField: "bucketId"
|
|
378
380
|
},
|
|
379
|
-
"Prisma.
|
|
381
|
+
"Prisma.App": {
|
|
380
382
|
type: "app",
|
|
381
|
-
idField: "
|
|
383
|
+
idField: "appId"
|
|
382
384
|
},
|
|
383
385
|
"Prisma.Deployment": {
|
|
384
386
|
type: "deployment",
|
|
@@ -386,7 +388,7 @@ const PLATFORM_RESOURCES = {
|
|
|
386
388
|
},
|
|
387
389
|
"Prisma.EnvironmentVariable": {
|
|
388
390
|
type: "config_variable",
|
|
389
|
-
idField: "
|
|
391
|
+
idField: "environmentVariableId"
|
|
390
392
|
}
|
|
391
393
|
};
|
|
392
394
|
/**
|
|
@@ -700,12 +702,16 @@ const FAMILY_BY_LEGACY_TYPE = {
|
|
|
700
702
|
"Prisma.ComputeService": "App",
|
|
701
703
|
"Prisma.Deployment": "Deployment",
|
|
702
704
|
"Prisma.EnvironmentVariable": "EnvironmentVariable",
|
|
705
|
+
"Prisma.Bucket": "Bucket",
|
|
706
|
+
"Prisma.BucketKey": "BucketAccessKey",
|
|
703
707
|
"PrismaComposer.Project": "Project",
|
|
704
708
|
"PrismaComposer.Database": "Database",
|
|
705
709
|
"PrismaComposer.Connection": "Connection",
|
|
706
710
|
"PrismaComposer.ComputeService": "App",
|
|
707
711
|
"PrismaComposer.Deployment": "Deployment",
|
|
708
|
-
"PrismaComposer.EnvironmentVariable": "EnvironmentVariable"
|
|
712
|
+
"PrismaComposer.EnvironmentVariable": "EnvironmentVariable",
|
|
713
|
+
"PrismaComposer.Bucket": "Bucket",
|
|
714
|
+
"PrismaComposer.BucketKey": "BucketAccessKey"
|
|
709
715
|
};
|
|
710
716
|
/** The type-id upstream registers each family under. */
|
|
711
717
|
const UPSTREAM_TYPE = {
|
|
@@ -714,7 +720,9 @@ const UPSTREAM_TYPE = {
|
|
|
714
720
|
Connection: "Prisma.Connection",
|
|
715
721
|
App: "Prisma.App",
|
|
716
722
|
Deployment: "Prisma.Deployment",
|
|
717
|
-
EnvironmentVariable: "Prisma.EnvironmentVariable"
|
|
723
|
+
EnvironmentVariable: "Prisma.EnvironmentVariable",
|
|
724
|
+
Bucket: "Prisma.Bucket",
|
|
725
|
+
BucketAccessKey: "Prisma.BucketAccessKey"
|
|
718
726
|
};
|
|
719
727
|
/**
|
|
720
728
|
* Four of the six families keep the type-id they always had, so the type-id
|
|
@@ -730,6 +738,8 @@ const isLegacyProps = (family, props) => {
|
|
|
730
738
|
case "App": return "projectId" in props && !("project" in props);
|
|
731
739
|
case "Deployment": return "computeServiceId" in props;
|
|
732
740
|
case "EnvironmentVariable": return "projectId" in props && !("project" in props);
|
|
741
|
+
case "Bucket": return "projectId" in props && !("project" in props);
|
|
742
|
+
case "BucketAccessKey": return "bucketId" in props && !("bucket" in props);
|
|
733
743
|
}
|
|
734
744
|
};
|
|
735
745
|
const migrateProps = (family, props) => {
|
|
@@ -770,6 +780,16 @@ const migrateProps = (family, props) => {
|
|
|
770
780
|
...props["branchId"] !== void 0 ? { branchId: props["branchId"] } : {}
|
|
771
781
|
};
|
|
772
782
|
}
|
|
783
|
+
case "Bucket": return {
|
|
784
|
+
project: props["projectId"],
|
|
785
|
+
name: props["name"],
|
|
786
|
+
...props["branchId"] !== void 0 ? { branchId: props["branchId"] } : {}
|
|
787
|
+
};
|
|
788
|
+
case "BucketAccessKey": return {
|
|
789
|
+
bucket: props["bucketId"],
|
|
790
|
+
name: props["name"],
|
|
791
|
+
role: props["role"]
|
|
792
|
+
};
|
|
773
793
|
}
|
|
774
794
|
};
|
|
775
795
|
/**
|
|
@@ -889,6 +909,26 @@ const migrateAttr = (family, attr, props) => {
|
|
|
889
909
|
createdAt: EPOCH,
|
|
890
910
|
updatedAt: EPOCH
|
|
891
911
|
};
|
|
912
|
+
case "Bucket":
|
|
913
|
+
if (typeof attr["id"] !== "string" || "bucketId" in attr) return attr;
|
|
914
|
+
return {
|
|
915
|
+
bucketId: attr["id"],
|
|
916
|
+
name: attr["name"],
|
|
917
|
+
projectId: oldProps["projectId"],
|
|
918
|
+
createdAt: EPOCH
|
|
919
|
+
};
|
|
920
|
+
case "BucketAccessKey": {
|
|
921
|
+
if (typeof attr["id"] !== "string" || "bucketAccessKeyId" in attr) return attr;
|
|
922
|
+
const secret = attr["secretAccessKey"];
|
|
923
|
+
return {
|
|
924
|
+
bucketAccessKeyId: attr["id"],
|
|
925
|
+
bucketId: attr["bucketId"],
|
|
926
|
+
accessKeyId: attr["accessKeyId"],
|
|
927
|
+
secretAccessKey: Redacted.isRedacted(secret) ? secret : Redacted.make(String(secret ?? "")),
|
|
928
|
+
endpoint: attr["endpoint"],
|
|
929
|
+
bucketName: attr["bucketName"]
|
|
930
|
+
};
|
|
931
|
+
}
|
|
892
932
|
}
|
|
893
933
|
};
|
|
894
934
|
const migrateResourceRow = (row) => {
|
|
@@ -1425,21 +1465,21 @@ function projectIdOf(application) {
|
|
|
1425
1465
|
/**
|
|
1426
1466
|
* One Bucket per module-provisioned bucket resource — `id` is the module
|
|
1427
1467
|
* provision id, so a resource shared by several consumers is created exactly
|
|
1428
|
-
* once. A
|
|
1429
|
-
* carrier, and its attributes (endpoint, bucketName, accessKeyId,
|
|
1468
|
+
* once. A BucketAccessKey is minted for the bucket: it is the reveal-once
|
|
1469
|
+
* credential carrier, and its attributes (endpoint, bucketName, accessKeyId,
|
|
1430
1470
|
* secretAccessKey) become the four S3Config outputs consumers resolve by name.
|
|
1431
1471
|
*/
|
|
1432
1472
|
function bucketDescriptor(_o) {
|
|
1433
1473
|
const lowering = ({ id, application }) => Effect.gen(function* () {
|
|
1434
1474
|
validateName(id, "resource name (from provision id)");
|
|
1435
1475
|
const branchId = cloudApplicationOf(application).branchId;
|
|
1436
|
-
const bkt = yield* Bucket(`${id}-bucket`, {
|
|
1437
|
-
|
|
1476
|
+
const bkt = yield* Prisma$1.Bucket(`${id}-bucket`, {
|
|
1477
|
+
project: projectIdOf(application),
|
|
1438
1478
|
name: id,
|
|
1439
1479
|
...branchId !== void 0 ? { branchId } : {}
|
|
1440
1480
|
});
|
|
1441
|
-
const key = yield*
|
|
1442
|
-
|
|
1481
|
+
const key = yield* Prisma$1.BucketAccessKey(`${id}-key`, {
|
|
1482
|
+
bucket: bkt.bucketId,
|
|
1443
1483
|
name: id,
|
|
1444
1484
|
role: "read_write"
|
|
1445
1485
|
});
|
|
@@ -1453,7 +1493,7 @@ function bucketDescriptor(_o) {
|
|
|
1453
1493
|
},
|
|
1454
1494
|
entities: [{
|
|
1455
1495
|
kind: "bucket",
|
|
1456
|
-
id: bkt.
|
|
1496
|
+
id: bkt.bucketId
|
|
1457
1497
|
}]
|
|
1458
1498
|
};
|
|
1459
1499
|
});
|
|
@@ -1469,15 +1509,6 @@ function bucketDescriptor(_o) {
|
|
|
1469
1509
|
*/
|
|
1470
1510
|
const envValue = (value) => Output.isOutput(value) ? Output.map(value, Redacted.make) : Redacted.make(value);
|
|
1471
1511
|
/**
|
|
1472
|
-
* The fingerprint stand-in for a row whose text this descriptor must NOT hash:
|
|
1473
|
-
* `kind` says which channel the row came from, and the sorted names of the
|
|
1474
|
-
* resources the value is built from say what produces it, so rewiring the row
|
|
1475
|
-
* to a different resource moves the fingerprint. `Output.upstreamAny` is the
|
|
1476
|
-
* same walker Alchemy builds its dependency graph with, so the names are the
|
|
1477
|
-
* planner's own — no guessing at what a reference points to.
|
|
1478
|
-
*/
|
|
1479
|
-
const withheldSource = (kind, upstream) => `${kind}:${Object.keys(upstream).sort().join(",")}`;
|
|
1480
|
-
/**
|
|
1481
1512
|
* Returns the PRECISE descriptor type, not the erased `NodeDescriptor`: the
|
|
1482
1513
|
* registry in control.ts erases it on assignment anyway (method bivariance),
|
|
1483
1514
|
* but s3-store composes over these hooks and needs their P/S to stay visible.
|
|
@@ -1490,7 +1521,7 @@ function computeDescriptor(o) {
|
|
|
1490
1521
|
validateName(id, "service name (from provision id)");
|
|
1491
1522
|
const projectId = projectIdOf(application);
|
|
1492
1523
|
const branchId = cloudApplicationOf(application).branchId;
|
|
1493
|
-
const svc = yield* Prisma.App(`${id}-svc`, {
|
|
1524
|
+
const svc = yield* Prisma$1.App(`${id}-svc`, {
|
|
1494
1525
|
project: projectId,
|
|
1495
1526
|
displayName: id,
|
|
1496
1527
|
regionId: o().region ?? "us-east-1",
|
|
@@ -1515,68 +1546,50 @@ function computeDescriptor(o) {
|
|
|
1515
1546
|
if (value === void 0) continue;
|
|
1516
1547
|
const key = configKey(address, d);
|
|
1517
1548
|
const rowValue = d.owner === "service" && isParamSource(value) ? encodeParamPointer(paramName(paramBindingFor(graph.params, address, d.name))) : encode(d.owner, value);
|
|
1518
|
-
const
|
|
1549
|
+
const wrapped = envValue(rowValue);
|
|
1550
|
+
const record = yield* Prisma$1.EnvironmentVariable(`${key}-var`, {
|
|
1519
1551
|
project: projectId,
|
|
1520
1552
|
key,
|
|
1521
|
-
value:
|
|
1553
|
+
value: wrapped,
|
|
1522
1554
|
class: cls,
|
|
1523
1555
|
...branch
|
|
1524
1556
|
});
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
rows.push({
|
|
1528
|
-
record,
|
|
1529
|
-
entry: {
|
|
1530
|
-
key,
|
|
1531
|
-
value: rowValue,
|
|
1532
|
-
...pointer !== void 0 ? { pointers: [pointer] } : {}
|
|
1533
|
-
}
|
|
1534
|
-
});
|
|
1535
|
-
} else if (Output.isOutput(value) || Object.keys(Output.upstreamAny(value)).length > 0) rows.push({
|
|
1536
|
-
record,
|
|
1537
|
-
entry: {
|
|
1538
|
-
key,
|
|
1539
|
-
withheld: withheldSource(`input.${d.owner.input}`, Output.upstreamAny(value))
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
else rows.push({
|
|
1557
|
+
const pointer = d.owner === "service" && isParamPointerRow(rowValue) ? decodeParamPointer(rowValue) : void 0;
|
|
1558
|
+
rows.push({
|
|
1543
1559
|
record,
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
}
|
|
1560
|
+
key,
|
|
1561
|
+
value: wrapped,
|
|
1562
|
+
...pointer !== void 0 ? { pointers: [pointer] } : {}
|
|
1548
1563
|
});
|
|
1549
1564
|
}
|
|
1550
1565
|
const inputRow = serializeInput(svc, address, graph.inputBindings.find((b) => b.serviceAddress === address)?.binding);
|
|
1551
1566
|
if (inputRow !== void 0) {
|
|
1567
|
+
const inputValue = envValue(inputRow.value);
|
|
1552
1568
|
rows.push({
|
|
1553
|
-
record: yield* Prisma.EnvironmentVariable(`${inputRow.key}-var`, {
|
|
1569
|
+
record: yield* Prisma$1.EnvironmentVariable(`${inputRow.key}-var`, {
|
|
1554
1570
|
project: projectId,
|
|
1555
1571
|
key: inputRow.key,
|
|
1556
|
-
value:
|
|
1572
|
+
value: inputValue,
|
|
1557
1573
|
class: cls,
|
|
1558
1574
|
...branch
|
|
1559
1575
|
}),
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
pointers: inputRow.secrets
|
|
1564
|
-
}
|
|
1576
|
+
key: inputRow.key,
|
|
1577
|
+
value: inputValue,
|
|
1578
|
+
pointers: inputRow.secrets
|
|
1565
1579
|
});
|
|
1566
1580
|
for (const leaf of inputRow.generated) {
|
|
1567
1581
|
const resource = yield* GeneratedParam(`${inputRow.key}:${leaf.path}-generated`, { bytes: leaf.bytes });
|
|
1582
|
+
const generatedValue = envValue(resource.value);
|
|
1568
1583
|
rows.push({
|
|
1569
|
-
record: yield* Prisma.EnvironmentVariable(`${leaf.varName}-var`, {
|
|
1584
|
+
record: yield* Prisma$1.EnvironmentVariable(`${leaf.varName}-var`, {
|
|
1570
1585
|
project: projectId,
|
|
1571
1586
|
key: leaf.varName,
|
|
1572
|
-
value:
|
|
1587
|
+
value: generatedValue,
|
|
1573
1588
|
class: cls,
|
|
1574
1589
|
...branch
|
|
1575
1590
|
}),
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
withheld: `generated:${String(leaf.bytes)}:${String(leaf.redacted)}`
|
|
1579
|
-
}
|
|
1591
|
+
key: leaf.varName,
|
|
1592
|
+
value: generatedValue
|
|
1580
1593
|
});
|
|
1581
1594
|
}
|
|
1582
1595
|
}
|
|
@@ -1598,24 +1611,24 @@ function computeDescriptor(o) {
|
|
|
1598
1611
|
name: entry.name
|
|
1599
1612
|
});
|
|
1600
1613
|
const value = Output.isOutput(raw) ? Output.map(raw, (v) => encode("service", v)) : encode("service", raw);
|
|
1614
|
+
const providerValue = envValue(value);
|
|
1601
1615
|
rows.push({
|
|
1602
|
-
record: yield* Prisma.EnvironmentVariable(`${key}-var`, {
|
|
1616
|
+
record: yield* Prisma$1.EnvironmentVariable(`${key}-var`, {
|
|
1603
1617
|
project: projectId,
|
|
1604
1618
|
key,
|
|
1605
|
-
value:
|
|
1619
|
+
value: providerValue,
|
|
1606
1620
|
class: cls,
|
|
1607
1621
|
...branch
|
|
1608
1622
|
}),
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
withheld: withheldSource(`provider.${entry.name}`, Output.upstreamAny(raw))
|
|
1612
|
-
}
|
|
1623
|
+
key,
|
|
1624
|
+
value: providerValue
|
|
1613
1625
|
});
|
|
1614
1626
|
}
|
|
1615
1627
|
const port = typeof config.service["port"] === "number" ? config.service["port"] : 3e3;
|
|
1616
1628
|
return {
|
|
1617
1629
|
environment: rows.map((r) => r.record),
|
|
1618
|
-
|
|
1630
|
+
triggers: Object.fromEntries(rows.map((r) => [r.key, r.value])),
|
|
1631
|
+
pointers: [...new Set(rows.flatMap((r) => r.pointers ?? []))],
|
|
1619
1632
|
port,
|
|
1620
1633
|
...inputRow !== void 0 ? { input: inputRow } : {}
|
|
1621
1634
|
};
|
|
@@ -1628,11 +1641,15 @@ function computeDescriptor(o) {
|
|
|
1628
1641
|
})),
|
|
1629
1642
|
deploy: ({ id }, provisioned, artifact, serialized) => Effect.gen(function* () {
|
|
1630
1643
|
const pointerUpdatedAt = o().pointerUpdatedAt;
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1644
|
+
const triggers = {
|
|
1645
|
+
...serialized.triggers,
|
|
1646
|
+
...Object.fromEntries(serialized.pointers.map((name) => [`${name}:updatedAt`, pointerUpdatedAt(name) ?? "?"]))
|
|
1647
|
+
};
|
|
1648
|
+
const deployment = yield* Prisma$1.Deployment(`${id}-deploy`, {
|
|
1633
1649
|
app: appAfterEnvironment(provisioned.serviceId, serialized.environment),
|
|
1634
|
-
artifactPath,
|
|
1650
|
+
artifactPath: artifact.path,
|
|
1635
1651
|
artifactContentType: ARTIFACT_CONTENT_TYPE,
|
|
1652
|
+
triggers,
|
|
1636
1653
|
portMapping: { http: serialized.port },
|
|
1637
1654
|
start: true,
|
|
1638
1655
|
promote: true
|
|
@@ -1665,12 +1682,12 @@ function postgresDescriptor(o) {
|
|
|
1665
1682
|
const lowering = ({ id, application }) => Effect.gen(function* () {
|
|
1666
1683
|
validateName(id, "resource name (from provision id)");
|
|
1667
1684
|
const branchId = cloudApplicationOf(application).branchId;
|
|
1668
|
-
const db = yield* Prisma.Database(`${id}-db`, {
|
|
1685
|
+
const db = yield* Prisma$1.Database(`${id}-db`, {
|
|
1669
1686
|
project: projectIdOf(application),
|
|
1670
1687
|
region: o().region ?? "us-east-1",
|
|
1671
1688
|
...branchId !== void 0 ? { branchId } : { name: id }
|
|
1672
1689
|
});
|
|
1673
|
-
const conn = yield* Prisma.Connection(`${id}-conn`, {
|
|
1690
|
+
const conn = yield* Prisma$1.Connection(`${id}-conn`, {
|
|
1674
1691
|
database: db,
|
|
1675
1692
|
name: id
|
|
1676
1693
|
});
|
|
@@ -1860,12 +1877,12 @@ function prismaNextDescriptor(o) {
|
|
|
1860
1877
|
const lowering = ({ id, node, application, graph }) => Effect.gen(function* () {
|
|
1861
1878
|
validateName(id, "resource name (from provision id)");
|
|
1862
1879
|
const branchId = cloudApplicationOf(application).branchId;
|
|
1863
|
-
const db = yield* Prisma.Database(`${id}-db`, {
|
|
1880
|
+
const db = yield* Prisma$1.Database(`${id}-db`, {
|
|
1864
1881
|
project: projectIdOf(application),
|
|
1865
1882
|
region: o().region ?? "us-east-1",
|
|
1866
1883
|
...branchId !== void 0 ? { branchId } : { name: id }
|
|
1867
1884
|
});
|
|
1868
|
-
const conn = yield* Prisma.Connection(`${id}-conn`, {
|
|
1885
|
+
const conn = yield* Prisma$1.Connection(`${id}-conn`, {
|
|
1869
1886
|
database: db,
|
|
1870
1887
|
name: id
|
|
1871
1888
|
});
|
|
@@ -2115,7 +2132,7 @@ const prismaState = () => ({
|
|
|
2115
2132
|
});
|
|
2116
2133
|
}
|
|
2117
2134
|
});
|
|
2118
|
-
const KNOWN_REGION_SET = new Set(Prisma.KNOWN_REGION_IDS);
|
|
2135
|
+
const KNOWN_REGION_SET = new Set(Prisma$1.KNOWN_REGION_IDS);
|
|
2119
2136
|
function isComputeRegion(value) {
|
|
2120
2137
|
return KNOWN_REGION_SET.has(value);
|
|
2121
2138
|
}
|
|
@@ -2196,7 +2213,7 @@ function resolveOptions(opts) {
|
|
|
2196
2213
|
workspaceId,
|
|
2197
2214
|
providerParams: PROVIDER_PARAMS
|
|
2198
2215
|
};
|
|
2199
|
-
if (!isComputeRegion(region)) throw new Error(`prismaCloud(): environment variable PRISMA_REGION="${region}" is not a known region (expected one of: ${Prisma.KNOWN_REGION_IDS.join(", ")}).`);
|
|
2216
|
+
if (!isComputeRegion(region)) throw new Error(`prismaCloud(): environment variable PRISMA_REGION="${region}" is not a known region (expected one of: ${Prisma$1.KNOWN_REGION_IDS.join(", ")}).`);
|
|
2200
2217
|
return {
|
|
2201
2218
|
workspaceId,
|
|
2202
2219
|
region,
|