@prisma/composer-prisma-cloud 0.1.0-dev.9 → 0.2.0-dev.1

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.
Files changed (45) hide show
  1. package/dist/control.d.mts +40 -34
  2. package/dist/control.mjs +512 -105
  3. package/dist/control.mjs.map +1 -1
  4. package/dist/cron/index.d.mts +54 -4
  5. package/dist/cron/index.mjs +154 -42
  6. package/dist/cron/index.mjs.map +1 -1
  7. package/dist/cron/scheduler-entrypoint.mjs +459 -306
  8. package/dist/cron/scheduler-entrypoint.mjs.map +1 -1
  9. package/dist/cron/scheduler-service.mjs +154 -42
  10. package/dist/cron/scheduler-service.mjs.map +1 -1
  11. package/dist/index.d.mts +76 -6
  12. package/dist/index.mjs +108 -45
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/{prisma-next-qPB8_Az6.mjs → prisma-next-DlU01kXJ-2sP5mQb6.mjs} +3 -3
  15. package/dist/prisma-next-DlU01kXJ-2sP5mQb6.mjs.map +1 -0
  16. package/dist/prisma-next.d.mts +1 -1
  17. package/dist/prisma-next.mjs +1 -1
  18. package/dist/{provisioned-edges-DIQAR4q4-Bn9op-JG.mjs → provisioned-edges-B_XS1Mz--NFJgcXK7.mjs} +66 -6
  19. package/dist/provisioned-edges-B_XS1Mz--NFJgcXK7.mjs.map +1 -0
  20. package/dist/{serializer-CX4VYdf_-KKGoAxfx.mjs → serializer-D8_84XWO-DA2B6YbX.mjs} +33 -3
  21. package/dist/serializer-D8_84XWO-DA2B6YbX.mjs.map +1 -0
  22. package/dist/storage/index.d.mts +62 -14
  23. package/dist/storage/index.mjs +168 -48
  24. package/dist/storage/index.mjs.map +1 -1
  25. package/dist/storage/storage-entrypoint.mjs +361 -239
  26. package/dist/storage/storage-entrypoint.mjs.map +1 -1
  27. package/dist/storage/storage-service.mjs +168 -48
  28. package/dist/storage/storage-service.mjs.map +1 -1
  29. package/dist/storage/testing.mjs.map +1 -1
  30. package/dist/streams/index.d.mts +62 -89
  31. package/dist/streams/index.mjs +169 -49
  32. package/dist/streams/index.mjs.map +1 -1
  33. package/dist/streams/streams-entrypoint.mjs +361 -239
  34. package/dist/streams/streams-entrypoint.mjs.map +1 -1
  35. package/dist/streams/streams-service.mjs +168 -48
  36. package/dist/streams/streams-service.mjs.map +1 -1
  37. package/dist/streams/testing.d.mts +1 -1
  38. package/dist/streams/testing.mjs.map +1 -1
  39. package/dist/testing.d.mts +1 -1
  40. package/dist/testing.mjs +1 -1
  41. package/dist/testing.mjs.map +1 -1
  42. package/package.json +14 -14
  43. package/dist/prisma-next-qPB8_Az6.mjs.map +0 -1
  44. package/dist/provisioned-edges-DIQAR4q4-Bn9op-JG.mjs.map +0 -1
  45. package/dist/serializer-CX4VYdf_-KKGoAxfx.mjs.map +0 -1
@@ -1,45 +1,20 @@
1
1
  import { t as ProviderParamEntry } from "./serializer-Cx5slrV4-xJfH6EWS.mjs";
2
- import * as Layer from "effect/Layer";
3
2
  import { createManagementApiClient } from "@prisma/management-api-sdk";
4
3
  import "effect/Context";
5
4
  import "effect/Effect";
5
+ import "effect/Layer";
6
6
  import "effect/Redacted";
7
7
  import "effect/Config";
8
8
  import "alchemy/Provider";
9
- import { Resource, StackServices } from "alchemy";
9
+ import { Resource } from "alchemy";
10
10
  import "effect/Schedule";
11
- import postgres from "postgres";
12
- import { State, StateStoreError } from "alchemy/State";
13
11
  import * as Output from "alchemy/Output";
14
- import { ExtensionDescriptor } from "@prisma/composer/config";
12
+ import { ExtensionDescriptor, StateDescriptor } from "@prisma/composer/config";
15
13
  //#region ../../1-prisma-cloud/0-lowering/lowering/dist/compute.d.mts
16
14
  /** Every region Prisma Compute serves — the runtime source of truth; `ComputeRegion` is derived from it so the two can never drift. */
17
15
  declare const COMPUTE_REGIONS: readonly ["us-east-1", "us-west-1", "eu-west-3", "eu-central-1", "ap-northeast-1", "ap-southeast-1"];
18
16
  type ComputeRegion = (typeof COMPUTE_REGIONS)[number];
19
17
  //#endregion
20
- //#region ../../1-prisma-cloud/0-lowering/lowering/dist/state.d.mts
21
- //#endregion
22
- //#region src/state/layer.d.ts
23
- /**
24
- * The hosted Alchemy state store. On layer init (scoped, once per stack
25
- * run): resolve the stage's Branch, find-or-create its `prisma-composer-state`
26
- * database, create a fresh connection, migrate the schema, and acquire the
27
- * (stack, stage) advisory lock — see `bootstrap.ts` and `lock.ts`. The
28
- * Management API plumbing (`ManagementClient`, `PrismaCredentials`) is
29
- * provided internally, so the returned layer's only requirements are the
30
- * ones alchemy itself already provides to every state store
31
- * (`StackServices`).
32
- *
33
- * Any bootstrap/lock/migration failure is wrapped into an operator-facing
34
- * `HostedStateBootstrapError` (naming the Project/Branch and the step that
35
- * failed, never the raw driver/API error — see `errors.ts`) before dying the
36
- * layer (loud, immediate, unrecoverable) rather than surfacing as a typed
37
- * error — matching core's `LowerOptions.state: Layer.Layer<State, never,
38
- * StackServices>` contract and alchemy's own convention (e.g. a missing
39
- * state store is `Effect.die` in `Stack.make`).
40
- */
41
- declare const prismaState: () => Layer.Layer<State, never, StackServices>;
42
- //#endregion
43
18
  //#region ../../1-prisma-cloud/1-extensions/target/dist/control.d.mts
44
19
  //#region src/descriptors/shared.d.ts
45
20
  /**
@@ -67,27 +42,58 @@ interface ProviderParam extends ProviderParamEntry {
67
42
  */
68
43
  readonly value: (refs: readonly unknown[]) => Output.Output<unknown> | unknown | undefined;
69
44
  }
45
+ /**
46
+ * The slice of compute's provisioned handoff a service-derived provider param
47
+ * may read. A minimal structural type, not `ComputeProvisioned` itself:
48
+ * shared.ts sits below `descriptors/compute.ts` in the import graph, so
49
+ * naming the full type here would invert it.
50
+ */
51
+ interface ServiceProvisionedAttributes {
52
+ readonly endpointDomain: Output.Output<string | undefined>;
53
+ }
54
+ /**
55
+ * A reserved provider param whose value derives from the provider service's
56
+ * OWN provisioned attributes rather than its inbound edges — the
57
+ * service-derived sibling of `ProviderParam` (e.g. the service's own origin).
58
+ * Asked for EVERY compute service, exposing or not: a service needs no
59
+ * consumers to have an origin, so the descriptor's expose check applies only
60
+ * to edge-derived entries. Like `ProviderParam.value`, the return is encoded
61
+ * through the serializer's normal service-own literal path (JSON) by the
62
+ * descriptor's generic loop, never here.
63
+ */
64
+ interface ServiceProviderParam extends ProviderParamEntry {
65
+ readonly valueForService: (provisioned: ServiceProvisionedAttributes, address: string) => Output.Output<unknown> | unknown | undefined;
66
+ }
70
67
  //#endregion
71
- //#region src/exports/control.d.ts
68
+ //#region src/control/extension.d.ts
69
+ /** The user-facing state descriptor: `state: prismaState()` in `prisma-composer.config.ts` (ADR-0017). */
70
+ declare const prismaState: () => StateDescriptor;
72
71
  interface PrismaCloudOptions {
73
72
  /** Defaults to the PRISMA_WORKSPACE_ID environment variable. */
74
73
  workspaceId?: string;
75
74
  /** Defaults to the PRISMA_REGION environment variable when set. */
76
75
  region?: ComputeRegion;
77
76
  }
77
+ /**
78
+ * One brand's deploy-side value registration: edge-derived (`value(refs)`,
79
+ * fed by the provider's inbound edges) or service-derived
80
+ * (`valueForService(provisioned, address)`, fed by the service's own
81
+ * provisioned attributes).
82
+ */
83
+ type ProviderParamValue = Pick<ProviderParam, 'value'> | Pick<ServiceProviderParam, 'valueForService'>;
78
84
  /**
79
85
  * Builds the deploy-side registry from the boot-side list, keyed by brand —
80
- * throws if a boot-side entry has no registered deploy-side `value(refs)`, so
81
- * `RESERVED_PROVIDER_PARAMS` stays the single source of which reserved
86
+ * throws if a boot-side entry has no registered deploy-side value function,
87
+ * so `RESERVED_PROVIDER_PARAMS` stays the single source of which reserved
82
88
  * provider params exist: deploy can no longer write a row boot never
83
89
  * stashes. Exported (rather than inlined into `PROVIDER_PARAMS` below) so
84
90
  * `__tests__/provider-params.test.ts` can drive it directly with a
85
91
  * deliberately incomplete value map and watch it throw.
86
92
  */
87
- declare function buildProviderParams(entries: readonly ProviderParamEntry[], values: ReadonlyMap<symbol, ProviderParam['value']>): ReadonlyMap<symbol, ProviderParam>;
88
- declare const PROVIDER_PARAMS: ReadonlyMap<symbol, ProviderParam>;
93
+ declare function buildProviderParams(entries: readonly ProviderParamEntry[], values: ReadonlyMap<symbol, ProviderParamValue>): ReadonlyMap<symbol, ProviderParam | ServiceProviderParam>;
94
+ declare const PROVIDER_PARAMS: ReadonlyMap<symbol, ProviderParam | ServiceProviderParam>;
89
95
  /** The Prisma Cloud extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
90
96
  declare const prismaCloud: (opts?: PrismaCloudOptions) => ExtensionDescriptor;
91
97
  //#endregion
92
- export { PROVIDER_PARAMS, PrismaCloudOptions, buildProviderParams, prismaCloud, prismaState };
98
+ export { PROVIDER_PARAMS, PrismaCloudOptions, ProviderParamValue, buildProviderParams, prismaCloud, prismaState };
93
99
  //# sourceMappingURL=control.d.mts.map