@sponson/sim 0.5.0 → 0.6.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/routes/cloud_run.d.ts +131 -0
- package/dist/routes/cloud_run.js +378 -0
- package/dist/routes/cloud_run.js.map +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.js +2 -1
- package/dist/state.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./routes/cloudflare.js";
|
|
|
17
17
|
export * from "./routes/algolia.js";
|
|
18
18
|
export * from "./routes/xata.js";
|
|
19
19
|
export * from "./routes/digitalocean.js";
|
|
20
|
+
export * from "./routes/cloud_run.js";
|
|
20
21
|
export { createSimServer } from "./server.js";
|
|
21
22
|
/**
|
|
22
23
|
* A running sim: its base URL (`simEnv` turns it into adapter environment), its live state for seeding and
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./routes/cloudflare.js";
|
|
|
18
18
|
export * from "./routes/algolia.js";
|
|
19
19
|
export * from "./routes/xata.js";
|
|
20
20
|
export * from "./routes/digitalocean.js";
|
|
21
|
+
export * from "./routes/cloud_run.js";
|
|
21
22
|
export { createSimServer } from "./server.js";
|
|
22
23
|
/** Start the fake cloud on 127.0.0.1. Port 0 picks a free one, which is what tests want. */
|
|
23
24
|
export async function startSim(opts = {}) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AAErE,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC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C,mBAAmB,EAAE,CAAC;YAC7B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC;KACL,CAAC;AACJ,CAAC;AAED,oHAAoH;AACpH,MAAM,CAAC,MAAM,UAAU,GAAqC,MAAM,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5L;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,GAA6B,EAAE,OAA6B,EAAE;IACnF,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACrD,MAAM,GAAG,GAA2B,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,CAAC;IACnF,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,eAAe,EAAE;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IAC9E,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simulated Google Cloud Run Admin API v2: services whose every template change makes an immutable revision, their
|
|
3
|
+
* traffic targets and tags, and the long-running operations a patch answers with.
|
|
4
|
+
*
|
|
5
|
+
* Assumptions about the real API this fake encodes, checked against the official REST reference and discovery
|
|
6
|
+
* document (https://run.googleapis.com/$discovery/rest?version=v2, called DISC below) unless marked unverified. The
|
|
7
|
+
* critical ones are pinned in scenarios/contract.test.ts (`assumption CR…`).
|
|
8
|
+
* CR1. The API is `https://run.googleapis.com/v2`; every method takes an OAuth access token with the
|
|
9
|
+
* `cloud-platform` scope as `Authorization: Bearer`, which `gcloud auth print-access-token` prints for the
|
|
10
|
+
* active account. (verified: DISC; https://docs.cloud.google.com/sdk/gcloud/reference/auth/print-access-token)
|
|
11
|
+
* CR2. `GET /v2/projects/{project}/locations/{region}/services/{service}` answers the Service: `etag` ("may be used
|
|
12
|
+
* to detect modification conflict during updates"), `template`, `traffic`, `trafficStatuses`,
|
|
13
|
+
* `latestReadyRevision`, `latestCreatedRevision`, `reconciling`, and `generation` as a JSON string (int64).
|
|
14
|
+
* (verified: DISC, https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.services)
|
|
15
|
+
* CR3. `PATCH /v2/{service.name}?updateMask=<fields>` takes a Service and answers a long-running Operation; only the
|
|
16
|
+
* fields the mask names are written. (verified: https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.services/patch;
|
|
17
|
+
* the sim refuses a patch without a mask, which the adapter never sends)
|
|
18
|
+
* CR4. Each change of `template` makes a new, immutable revision; `template.revision` names it ("If this field is
|
|
19
|
+
* omitted, it will be automatically generated based on the Service name"). A name starts with the service's
|
|
20
|
+
* name and `-`, has only lowercase letters, digits and `-`, does not end with `-` and is at most 63 characters.
|
|
21
|
+
* (verified: DISC; https://docs.cloud.google.com/run/docs/configuring/services/containers) A name already
|
|
22
|
+
* taken is refused (unverified: the sim answers 409 ALREADY_EXISTS).
|
|
23
|
+
* CR5. A TrafficTarget is `{ type, revision, percent, tag }`, `type` `TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST` or
|
|
24
|
+
* `…_REVISION`, `percent` zero when left out; empty `traffic` means 100% to the latest ready revision. LATEST
|
|
25
|
+
* follows the latest ready revision, so a template change alone moves its share to the new revision; gcloud's
|
|
26
|
+
* `--no-traffic` "assigns any traffic assigned to the LATEST revision to the specific revision bound to LATEST
|
|
27
|
+
* before the deployment", after which "the LATEST revision will not receive traffic on future deployments".
|
|
28
|
+
* (verified: DISC; https://docs.cloud.google.com/sdk/gcloud/reference/run/deploy)
|
|
29
|
+
* CR6. A `tag` gives its revision a URL of its own with no traffic ("test the new revision at a specific URL,
|
|
30
|
+
* without serving traffic"), shown in `trafficStatuses[].uri` ("Displays the target URI"); its form is not to be
|
|
31
|
+
* parsed ("Don't parse the SERVICE_IDENTIFIER"), so it is read, never built. (verified:
|
|
32
|
+
* https://docs.cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration,
|
|
33
|
+
* https://docs.cloud.google.com/run/docs/triggering/https-request)
|
|
34
|
+
* CR7. Whether `latestReadyRevision`, `latestCreatedRevision` and `TrafficTarget.revision` hold a revision's short
|
|
35
|
+
* name or its full resource name is not documented (unverified): clients take the last path segment; the sim
|
|
36
|
+
* answers full names in `latest*Revision` and the names it was sent in `traffic`.
|
|
37
|
+
* CR8. The `etag` sent in a patch body is a precondition: a patch whose etag is no longer the service's is refused
|
|
38
|
+
* and changes nothing. (unverified: the docs say only that it "may be used to detect modification conflict";
|
|
39
|
+
* the sim answers 409 ABORTED)
|
|
40
|
+
* CR9. `GET /v2/{name=projects/*\/locations/*\/operations/*}` answers `{ name, done, error, response }`; when `done`,
|
|
41
|
+
* "either `error` or `response` is available". (verified: DISC) The operation of a template change ends when
|
|
42
|
+
* the new revision is ready, or with an `error` when it cannot become ready (unverified: the sim ends it after
|
|
43
|
+
* `operationPolls` polls, failing it for an image in `failImages`).
|
|
44
|
+
* CR10. `GET …/services/{service}/revisions/{revision}` answers the Revision: `containers` (`name`, `image`, `env`
|
|
45
|
+
* of `{ name, value }` or `{ name, valueSource: { secretKeyRef } }`) and `conditions` of `{ type, state }`,
|
|
46
|
+
* where type "Ready" is "True when the Resource is ready" and state is CONDITION_SUCCEEDED, CONDITION_FAILED,
|
|
47
|
+
* CONDITION_PENDING or CONDITION_RECONCILING. (verified: DISC)
|
|
48
|
+
* CR11. Once an operation has succeeded, the Service answers the new `traffic` and its `trafficStatuses`
|
|
49
|
+
* (`reconciling` false: then they "will match"). (verified: DISC, `reconciling`)
|
|
50
|
+
* CR12. Cloud Run deletes revisions by itself: past 1000 per service, "non-addressable revisions are automatically
|
|
51
|
+
* deleted in historical order"; past 2000 tags per project and region, "tags that don't have a specified
|
|
52
|
+
* traffic percentage are automatically deleted". (verified: https://docs.cloud.google.com/run/quotas) Whether
|
|
53
|
+
* a tagged revision counts as addressable is not documented. The sim does not delete anything by itself.
|
|
54
|
+
* CR13. A tag is lowercase (the only documented rule, "your lowercase tag name"); the sim also refuses one that is
|
|
55
|
+
* not a DNS label (`^[a-z]([a-z0-9-]*[a-z0-9])?$`) or that two targets share. (unverified)
|
|
56
|
+
*/
|
|
57
|
+
import { type CreatedBy, type ProviderSim } from "../provider.js";
|
|
58
|
+
/** One traffic target, as sent and stored (CR5). */
|
|
59
|
+
export interface CloudRunTrafficTarget {
|
|
60
|
+
type: string;
|
|
61
|
+
revision?: string;
|
|
62
|
+
percent?: number;
|
|
63
|
+
tag?: string;
|
|
64
|
+
}
|
|
65
|
+
/** A revision: the template it was made from, and whether it came up (CR4, CR10). */
|
|
66
|
+
export interface CloudRunRevision {
|
|
67
|
+
name: string;
|
|
68
|
+
/** `<project>/<region>/<service>`. */
|
|
69
|
+
service: string;
|
|
70
|
+
template: Record<string, unknown>;
|
|
71
|
+
state: "pending" | "ready" | "failed";
|
|
72
|
+
createdBy: CreatedBy;
|
|
73
|
+
}
|
|
74
|
+
/** A Cloud Run service. */
|
|
75
|
+
export interface CloudRunService {
|
|
76
|
+
project: string;
|
|
77
|
+
region: string;
|
|
78
|
+
name: string;
|
|
79
|
+
generation: number;
|
|
80
|
+
etag: string;
|
|
81
|
+
template: Record<string, unknown>;
|
|
82
|
+
traffic: CloudRunTrafficTarget[];
|
|
83
|
+
latestCreated: string;
|
|
84
|
+
latestReady: string;
|
|
85
|
+
/** The part of its URLs Cloud Run makes up (CR6). */
|
|
86
|
+
identifier: string;
|
|
87
|
+
createdBy: CreatedBy;
|
|
88
|
+
}
|
|
89
|
+
/** A long-running operation a patch started (CR9). */
|
|
90
|
+
export interface CloudRunOperation {
|
|
91
|
+
name: string;
|
|
92
|
+
service: string;
|
|
93
|
+
/** The revision it brings up, for a template change. */
|
|
94
|
+
revision: string | null;
|
|
95
|
+
polls: number;
|
|
96
|
+
done: boolean;
|
|
97
|
+
error?: {
|
|
98
|
+
code: number;
|
|
99
|
+
message: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** The simulated Cloud Run's state. */
|
|
103
|
+
export interface CloudRunState {
|
|
104
|
+
services: CloudRunService[];
|
|
105
|
+
revisions: CloudRunRevision[];
|
|
106
|
+
operations: CloudRunOperation[];
|
|
107
|
+
/** Polls an operation answers `done: false` before it ends (default 1). */
|
|
108
|
+
operationPolls: number;
|
|
109
|
+
/** Images whose revisions never become ready. */
|
|
110
|
+
failImages: string[];
|
|
111
|
+
}
|
|
112
|
+
/** One service a scenario or test seeds (`seed: { cloud_run: { services: [...] } }`). */
|
|
113
|
+
export interface CloudRunSeedService {
|
|
114
|
+
/** Default `demo-project`. */
|
|
115
|
+
project?: string;
|
|
116
|
+
/** Default `us-central1`. */
|
|
117
|
+
region?: string;
|
|
118
|
+
name: string;
|
|
119
|
+
image?: string;
|
|
120
|
+
env?: Record<string, string>;
|
|
121
|
+
/** `latest` (default): all traffic to LATEST; `pinned`: all traffic to the first revision by name. */
|
|
122
|
+
traffic?: "latest" | "pinned";
|
|
123
|
+
}
|
|
124
|
+
/** What a scenario or test seeds the simulated Cloud Run with. */
|
|
125
|
+
export interface CloudRunSeed {
|
|
126
|
+
services?: CloudRunSeedService[];
|
|
127
|
+
operationPolls?: number;
|
|
128
|
+
failImages?: string[];
|
|
129
|
+
}
|
|
130
|
+
/** The simulated Cloud Run Admin API, registered in `PROVIDERS` (packages/sim/src/state.ts) and served under `/cloud_run`. */
|
|
131
|
+
export declare const cloudRunSim: ProviderSim<CloudRunState, CloudRunSeed>;
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simulated Google Cloud Run Admin API v2: services whose every template change makes an immutable revision, their
|
|
3
|
+
* traffic targets and tags, and the long-running operations a patch answers with.
|
|
4
|
+
*
|
|
5
|
+
* Assumptions about the real API this fake encodes, checked against the official REST reference and discovery
|
|
6
|
+
* document (https://run.googleapis.com/$discovery/rest?version=v2, called DISC below) unless marked unverified. The
|
|
7
|
+
* critical ones are pinned in scenarios/contract.test.ts (`assumption CR…`).
|
|
8
|
+
* CR1. The API is `https://run.googleapis.com/v2`; every method takes an OAuth access token with the
|
|
9
|
+
* `cloud-platform` scope as `Authorization: Bearer`, which `gcloud auth print-access-token` prints for the
|
|
10
|
+
* active account. (verified: DISC; https://docs.cloud.google.com/sdk/gcloud/reference/auth/print-access-token)
|
|
11
|
+
* CR2. `GET /v2/projects/{project}/locations/{region}/services/{service}` answers the Service: `etag` ("may be used
|
|
12
|
+
* to detect modification conflict during updates"), `template`, `traffic`, `trafficStatuses`,
|
|
13
|
+
* `latestReadyRevision`, `latestCreatedRevision`, `reconciling`, and `generation` as a JSON string (int64).
|
|
14
|
+
* (verified: DISC, https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.services)
|
|
15
|
+
* CR3. `PATCH /v2/{service.name}?updateMask=<fields>` takes a Service and answers a long-running Operation; only the
|
|
16
|
+
* fields the mask names are written. (verified: https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.services/patch;
|
|
17
|
+
* the sim refuses a patch without a mask, which the adapter never sends)
|
|
18
|
+
* CR4. Each change of `template` makes a new, immutable revision; `template.revision` names it ("If this field is
|
|
19
|
+
* omitted, it will be automatically generated based on the Service name"). A name starts with the service's
|
|
20
|
+
* name and `-`, has only lowercase letters, digits and `-`, does not end with `-` and is at most 63 characters.
|
|
21
|
+
* (verified: DISC; https://docs.cloud.google.com/run/docs/configuring/services/containers) A name already
|
|
22
|
+
* taken is refused (unverified: the sim answers 409 ALREADY_EXISTS).
|
|
23
|
+
* CR5. A TrafficTarget is `{ type, revision, percent, tag }`, `type` `TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST` or
|
|
24
|
+
* `…_REVISION`, `percent` zero when left out; empty `traffic` means 100% to the latest ready revision. LATEST
|
|
25
|
+
* follows the latest ready revision, so a template change alone moves its share to the new revision; gcloud's
|
|
26
|
+
* `--no-traffic` "assigns any traffic assigned to the LATEST revision to the specific revision bound to LATEST
|
|
27
|
+
* before the deployment", after which "the LATEST revision will not receive traffic on future deployments".
|
|
28
|
+
* (verified: DISC; https://docs.cloud.google.com/sdk/gcloud/reference/run/deploy)
|
|
29
|
+
* CR6. A `tag` gives its revision a URL of its own with no traffic ("test the new revision at a specific URL,
|
|
30
|
+
* without serving traffic"), shown in `trafficStatuses[].uri` ("Displays the target URI"); its form is not to be
|
|
31
|
+
* parsed ("Don't parse the SERVICE_IDENTIFIER"), so it is read, never built. (verified:
|
|
32
|
+
* https://docs.cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration,
|
|
33
|
+
* https://docs.cloud.google.com/run/docs/triggering/https-request)
|
|
34
|
+
* CR7. Whether `latestReadyRevision`, `latestCreatedRevision` and `TrafficTarget.revision` hold a revision's short
|
|
35
|
+
* name or its full resource name is not documented (unverified): clients take the last path segment; the sim
|
|
36
|
+
* answers full names in `latest*Revision` and the names it was sent in `traffic`.
|
|
37
|
+
* CR8. The `etag` sent in a patch body is a precondition: a patch whose etag is no longer the service's is refused
|
|
38
|
+
* and changes nothing. (unverified: the docs say only that it "may be used to detect modification conflict";
|
|
39
|
+
* the sim answers 409 ABORTED)
|
|
40
|
+
* CR9. `GET /v2/{name=projects/*\/locations/*\/operations/*}` answers `{ name, done, error, response }`; when `done`,
|
|
41
|
+
* "either `error` or `response` is available". (verified: DISC) The operation of a template change ends when
|
|
42
|
+
* the new revision is ready, or with an `error` when it cannot become ready (unverified: the sim ends it after
|
|
43
|
+
* `operationPolls` polls, failing it for an image in `failImages`).
|
|
44
|
+
* CR10. `GET …/services/{service}/revisions/{revision}` answers the Revision: `containers` (`name`, `image`, `env`
|
|
45
|
+
* of `{ name, value }` or `{ name, valueSource: { secretKeyRef } }`) and `conditions` of `{ type, state }`,
|
|
46
|
+
* where type "Ready" is "True when the Resource is ready" and state is CONDITION_SUCCEEDED, CONDITION_FAILED,
|
|
47
|
+
* CONDITION_PENDING or CONDITION_RECONCILING. (verified: DISC)
|
|
48
|
+
* CR11. Once an operation has succeeded, the Service answers the new `traffic` and its `trafficStatuses`
|
|
49
|
+
* (`reconciling` false: then they "will match"). (verified: DISC, `reconciling`)
|
|
50
|
+
* CR12. Cloud Run deletes revisions by itself: past 1000 per service, "non-addressable revisions are automatically
|
|
51
|
+
* deleted in historical order"; past 2000 tags per project and region, "tags that don't have a specified
|
|
52
|
+
* traffic percentage are automatically deleted". (verified: https://docs.cloud.google.com/run/quotas) Whether
|
|
53
|
+
* a tagged revision counts as addressable is not documented. The sim does not delete anything by itself.
|
|
54
|
+
* CR13. A tag is lowercase (the only documented rule, "your lowercase tag name"); the sim also refuses one that is
|
|
55
|
+
* not a DNS label (`^[a-z]([a-z0-9-]*[a-z0-9])?$`) or that two targets share. (unverified)
|
|
56
|
+
*/
|
|
57
|
+
import { Reply, route, router } from "../provider.js";
|
|
58
|
+
const LATEST = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST";
|
|
59
|
+
const BY_REVISION = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION";
|
|
60
|
+
const DEFAULT_IMAGE = "us-docker.pkg.dev/demo-project/web/app:main";
|
|
61
|
+
/** The simulated Cloud Run Admin API, registered in `PROVIDERS` (packages/sim/src/state.ts) and served under `/cloud_run`. */
|
|
62
|
+
export const cloudRunSim = {
|
|
63
|
+
// The adapter takes its token from `gcloud auth print-access-token` (CR1); this variable is only the placeholder.
|
|
64
|
+
env: { token: "CLOUD_RUN_SIM_ACCESS_TOKEN", url: "CLOUD_RUN_API_URL", testToken: "tok_cloud_run" },
|
|
65
|
+
defaultSeed: { services: [{ name: "web", env: { NODE_ENV: "production", DATABASE_URL: "postgres://prod.example.com/app" } }] },
|
|
66
|
+
reset(core, seed) {
|
|
67
|
+
const state = { services: [], revisions: [], operations: [], operationPolls: seed?.operationPolls ?? 1, failImages: [...(seed?.failImages ?? [])] };
|
|
68
|
+
for (const s of seed?.services ?? [])
|
|
69
|
+
seedService(core, state, s);
|
|
70
|
+
return state;
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* `service.<name>.tag.<tag>.env.<NAME>`: someone deploys the tagged revision again with that variable changed and
|
|
74
|
+
* the tag moved to the new revision (`gcloud run deploy --no-traffic --tag <tag> --update-env-vars`);
|
|
75
|
+
* `service.<name>.tag.<tag>` = "delete": the tag removed (`update-traffic --remove-tags`); `service.<name>.deploy`
|
|
76
|
+
* = an image: a deploy of the service's template with that image (traffic as it stands, CR5).
|
|
77
|
+
*/
|
|
78
|
+
drift(core, state, { key, rest, value, only }) {
|
|
79
|
+
if (only !== undefined || !rest.startsWith("service."))
|
|
80
|
+
return false;
|
|
81
|
+
const [name, kind, tag, sub, envName] = rest.slice("service.".length).split(".");
|
|
82
|
+
const svc = state.services.find((s) => s.name === name);
|
|
83
|
+
if (!svc)
|
|
84
|
+
throw new Error(`drift ${key}: no service ${String(name)}`);
|
|
85
|
+
if (kind === "deploy" && tag === undefined)
|
|
86
|
+
deployImage(core, state, svc, value);
|
|
87
|
+
else if (kind === "tag" && tag && sub === undefined && value === "delete")
|
|
88
|
+
removeTag(core, svc, tag);
|
|
89
|
+
else if (kind === "tag" && tag && sub === "env" && envName)
|
|
90
|
+
redeployTagged(core, state, svc, tag, envName, value);
|
|
91
|
+
else
|
|
92
|
+
throw new Error(`drift ${key}: use service.<name>.deploy = <image>, service.<name>.tag.<tag> = delete, or service.<name>.tag.<tag>.env.<NAME> = <value>`);
|
|
93
|
+
return true;
|
|
94
|
+
},
|
|
95
|
+
routes(core, state, req) {
|
|
96
|
+
return routes(core, state, req);
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// State
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
function keyOf(s) {
|
|
103
|
+
return `${s.project}/${s.region}/${s.name}`;
|
|
104
|
+
}
|
|
105
|
+
function fullName(s) {
|
|
106
|
+
return `projects/${s.project}/locations/${s.region}/services/${s.name}`;
|
|
107
|
+
}
|
|
108
|
+
function revisionFullName(s, revision) {
|
|
109
|
+
return `${fullName(s)}/revisions/${revision}`;
|
|
110
|
+
}
|
|
111
|
+
function bump(core, svc) {
|
|
112
|
+
svc.generation += 1;
|
|
113
|
+
svc.etag = `"${core.nextId("etag-")}"`;
|
|
114
|
+
}
|
|
115
|
+
function seedService(core, state, s) {
|
|
116
|
+
const project = s.project ?? "demo-project";
|
|
117
|
+
const region = s.region ?? "us-central1";
|
|
118
|
+
const first = `${s.name}-00001-abc`;
|
|
119
|
+
const template = { containers: [{ name: "app", image: s.image ?? DEFAULT_IMAGE, ports: [{ containerPort: 8080 }], env: Object.entries(s.env ?? {}).map(([name, value]) => ({ name, value })) }] };
|
|
120
|
+
const svc = {
|
|
121
|
+
project,
|
|
122
|
+
region,
|
|
123
|
+
name: s.name,
|
|
124
|
+
generation: 1,
|
|
125
|
+
etag: `"${core.nextId("etag-")}"`,
|
|
126
|
+
template,
|
|
127
|
+
traffic: s.traffic === "pinned" ? [{ type: BY_REVISION, revision: first, percent: 100 }] : [{ type: LATEST, percent: 100 }],
|
|
128
|
+
latestCreated: first,
|
|
129
|
+
latestReady: first,
|
|
130
|
+
identifier: `${core.nextId("h")}x3bz5a7c2q-uc`,
|
|
131
|
+
createdBy: "sim",
|
|
132
|
+
};
|
|
133
|
+
state.services.push(svc);
|
|
134
|
+
state.revisions.push({ name: first, service: keyOf(svc), template: structuredClone(template), state: "ready", createdBy: "sim" });
|
|
135
|
+
}
|
|
136
|
+
/** A revision of `svc` made outside the API (a human's deploy), ready at once. */
|
|
137
|
+
function addReadyRevision(core, state, svc, template) {
|
|
138
|
+
const name = `${svc.name}-${String(svc.generation + 1).padStart(5, "0")}-${core.nextId("r")}`;
|
|
139
|
+
const t = structuredClone(template);
|
|
140
|
+
delete t.revision;
|
|
141
|
+
state.revisions.push({ name, service: keyOf(svc), template: structuredClone(t), state: "ready", createdBy: "sim" });
|
|
142
|
+
svc.template = t;
|
|
143
|
+
svc.latestCreated = name;
|
|
144
|
+
svc.latestReady = name;
|
|
145
|
+
bump(core, svc);
|
|
146
|
+
return name;
|
|
147
|
+
}
|
|
148
|
+
function deployImage(core, state, svc, image) {
|
|
149
|
+
const t = structuredClone(svc.template);
|
|
150
|
+
const c = t.containers[0];
|
|
151
|
+
c.image = image;
|
|
152
|
+
addReadyRevision(core, state, svc, t);
|
|
153
|
+
}
|
|
154
|
+
function removeTag(core, svc, tag) {
|
|
155
|
+
const t = svc.traffic.find((x) => x.tag === tag);
|
|
156
|
+
if (!t)
|
|
157
|
+
throw new Error(`drift: service ${svc.name} has no tag ${tag}`);
|
|
158
|
+
if (!t.percent)
|
|
159
|
+
svc.traffic = svc.traffic.filter((x) => x !== t);
|
|
160
|
+
else
|
|
161
|
+
delete t.tag;
|
|
162
|
+
bump(core, svc);
|
|
163
|
+
}
|
|
164
|
+
function redeployTagged(core, state, svc, tag, envName, value) {
|
|
165
|
+
const target = svc.traffic.find((x) => x.tag === tag);
|
|
166
|
+
const base = target ? state.revisions.find((r) => r.service === keyOf(svc) && r.name === lastSegment(target.revision ?? svc.latestReady)) : undefined;
|
|
167
|
+
if (!target || !base)
|
|
168
|
+
throw new Error(`drift: service ${svc.name} has no tagged revision ${tag}`);
|
|
169
|
+
// `--no-traffic`: LATEST's share stays with the revision it pointed at (CR5).
|
|
170
|
+
svc.traffic = svc.traffic.map((x) => (x.type === LATEST ? { ...x, type: BY_REVISION, revision: svc.latestReady } : x));
|
|
171
|
+
const t = structuredClone(base.template);
|
|
172
|
+
const c = t.containers[0];
|
|
173
|
+
const env = (c.env ?? []).filter((e) => e.name !== envName);
|
|
174
|
+
c.env = [...env, { name: envName, value }];
|
|
175
|
+
const name = addReadyRevision(core, state, svc, t);
|
|
176
|
+
const moved = svc.traffic.find((x) => x.tag === tag);
|
|
177
|
+
moved.type = BY_REVISION;
|
|
178
|
+
moved.revision = name;
|
|
179
|
+
}
|
|
180
|
+
function lastSegment(name) {
|
|
181
|
+
return name.slice(name.lastIndexOf("/") + 1);
|
|
182
|
+
}
|
|
183
|
+
// ---------------------------------------------------------------------------
|
|
184
|
+
// Operations
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
186
|
+
function imageOf(template) {
|
|
187
|
+
const c = template.containers?.[0];
|
|
188
|
+
return typeof c?.image === "string" ? c.image : undefined;
|
|
189
|
+
}
|
|
190
|
+
/** End an operation: its revision comes up (or fails to, CR9). */
|
|
191
|
+
function settle(state, op) {
|
|
192
|
+
op.done = true;
|
|
193
|
+
const svc = state.services.find((s) => keyOf(s) === op.service);
|
|
194
|
+
const rev = op.revision ? state.revisions.find((r) => r.service === op.service && r.name === op.revision) : undefined;
|
|
195
|
+
if (!svc || !rev)
|
|
196
|
+
return;
|
|
197
|
+
if (state.failImages.includes(imageOf(rev.template) ?? "")) {
|
|
198
|
+
rev.state = "failed";
|
|
199
|
+
op.error = { code: 9, message: `Revision '${rev.name}' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable.` };
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
rev.state = "ready";
|
|
203
|
+
svc.latestReady = rev.name;
|
|
204
|
+
}
|
|
205
|
+
/** One poll of an operation: it ends after `operationPolls` of them. */
|
|
206
|
+
function tick(state, op) {
|
|
207
|
+
if (op.done)
|
|
208
|
+
return;
|
|
209
|
+
if (op.polls > 0)
|
|
210
|
+
op.polls -= 1;
|
|
211
|
+
else
|
|
212
|
+
settle(state, op);
|
|
213
|
+
}
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
// Answers
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
function googleError(status, code, message) {
|
|
218
|
+
return new Reply(status, { error: { code: status, message, status: code } });
|
|
219
|
+
}
|
|
220
|
+
const notFound = () => googleError(404, "NOT_FOUND", "Requested entity was not found.");
|
|
221
|
+
function trafficStatuses(svc) {
|
|
222
|
+
return svc.traffic.map((t) => ({
|
|
223
|
+
type: t.type,
|
|
224
|
+
revision: t.type === LATEST ? svc.latestReady : lastSegment(t.revision ?? ""),
|
|
225
|
+
...(t.percent ? { percent: t.percent } : {}),
|
|
226
|
+
...(t.tag ? { tag: t.tag, uri: `https://${t.tag}---${svc.name}-${svc.identifier}.a.run.app` } : {}),
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
function publicService(state, svc) {
|
|
230
|
+
const reconciling = state.operations.some((o) => o.service === keyOf(svc) && !o.done);
|
|
231
|
+
return {
|
|
232
|
+
name: fullName(svc),
|
|
233
|
+
generation: String(svc.generation),
|
|
234
|
+
observedGeneration: String(reconciling ? svc.generation - 1 : svc.generation),
|
|
235
|
+
etag: svc.etag,
|
|
236
|
+
template: svc.template,
|
|
237
|
+
traffic: svc.traffic,
|
|
238
|
+
trafficStatuses: trafficStatuses(svc),
|
|
239
|
+
uri: `https://${svc.name}-${svc.identifier}.a.run.app`,
|
|
240
|
+
latestCreatedRevision: revisionFullName(svc, svc.latestCreated),
|
|
241
|
+
latestReadyRevision: revisionFullName(svc, svc.latestReady),
|
|
242
|
+
reconciling,
|
|
243
|
+
terminalCondition: { type: "Ready", state: reconciling ? "CONDITION_RECONCILING" : "CONDITION_SUCCEEDED" },
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
const CONDITION = { pending: "CONDITION_RECONCILING", ready: "CONDITION_SUCCEEDED", failed: "CONDITION_FAILED" };
|
|
247
|
+
function publicRevision(svc, rev) {
|
|
248
|
+
return {
|
|
249
|
+
name: revisionFullName(svc, rev.name),
|
|
250
|
+
service: fullName(svc),
|
|
251
|
+
containers: rev.template.containers,
|
|
252
|
+
reconciling: rev.state === "pending",
|
|
253
|
+
conditions: [{ type: "Ready", state: CONDITION[rev.state] }],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function publicOperation(state, op) {
|
|
257
|
+
const svc = state.services.find((s) => keyOf(s) === op.service);
|
|
258
|
+
const outcome = !op.done ? {} : op.error ? { error: op.error } : { response: svc ? { "@type": "type.googleapis.com/google.cloud.run.v2.Service", ...publicService(state, svc) } : {} };
|
|
259
|
+
return { name: op.name, metadata: { "@type": "type.googleapis.com/google.cloud.run.v2.Service", name: svc ? fullName(svc) : "" }, done: op.done, ...outcome };
|
|
260
|
+
}
|
|
261
|
+
// ---------------------------------------------------------------------------
|
|
262
|
+
// The patch (CR3, CR4, CR5, CR8)
|
|
263
|
+
// ---------------------------------------------------------------------------
|
|
264
|
+
const MASK_FIELDS = new Set(["template", "traffic"]);
|
|
265
|
+
const TAG = /^[a-z]([a-z0-9-]*[a-z0-9])?$/;
|
|
266
|
+
function maskOf(url) {
|
|
267
|
+
const raw = url.searchParams.get("updateMask");
|
|
268
|
+
if (!raw)
|
|
269
|
+
return googleError(400, "INVALID_ARGUMENT", "updateMask is required (the sim's own strictness)");
|
|
270
|
+
const fields = raw.split(",").map((f) => f.trim());
|
|
271
|
+
const unknown = fields.find((f) => !MASK_FIELDS.has(f));
|
|
272
|
+
if (unknown)
|
|
273
|
+
return googleError(400, "INVALID_ARGUMENT", `updateMask: field \`${unknown}\` is not one the sim can update`);
|
|
274
|
+
return new Set(fields);
|
|
275
|
+
}
|
|
276
|
+
/** The revision a template change makes: its name (CR4), or what is wrong with the template. */
|
|
277
|
+
function newRevisionName(core, state, svc, template) {
|
|
278
|
+
const containers = template?.containers;
|
|
279
|
+
if (!Array.isArray(containers) || containers.length === 0 || !containers.every((c) => typeof c?.image === "string")) {
|
|
280
|
+
return googleError(400, "INVALID_ARGUMENT", "template.containers: at least one container with an image is required");
|
|
281
|
+
}
|
|
282
|
+
const named = template.revision;
|
|
283
|
+
if (named === undefined || named === "")
|
|
284
|
+
return `${svc.name}-${String(svc.generation + 1).padStart(5, "0")}-${core.nextId("r")}`;
|
|
285
|
+
if (typeof named !== "string" || !named.startsWith(`${svc.name}-`) || named.length > 63 || !/^[a-z0-9-]*[a-z0-9]$/.test(named)) {
|
|
286
|
+
return googleError(400, "INVALID_ARGUMENT", `template.revision: ${String(named)} must start with ${svc.name}-, use lowercase letters, digits and -, not end with - and be at most 63 characters`);
|
|
287
|
+
}
|
|
288
|
+
if (state.revisions.some((r) => r.service === keyOf(svc) && r.name === named))
|
|
289
|
+
return googleError(409, "ALREADY_EXISTS", `Revision ${named} already exists.`);
|
|
290
|
+
return named;
|
|
291
|
+
}
|
|
292
|
+
/** What is wrong with one traffic target (CR5), or undefined. */
|
|
293
|
+
function targetProblem(t, known) {
|
|
294
|
+
if (t.type !== LATEST && t.type !== BY_REVISION)
|
|
295
|
+
return `traffic: unknown type ${String(t.type)}`;
|
|
296
|
+
if (t.type === BY_REVISION && (typeof t.revision !== "string" || !known.has(lastSegment(t.revision))))
|
|
297
|
+
return `traffic: revision ${String(t.revision)} does not exist`;
|
|
298
|
+
const percent = t.percent ?? 0;
|
|
299
|
+
if (typeof percent !== "number" || !Number.isInteger(percent) || percent < 0 || percent > 100)
|
|
300
|
+
return "traffic: percent must be 0 to 100";
|
|
301
|
+
if (t.tag !== undefined && (typeof t.tag !== "string" || !TAG.test(t.tag)))
|
|
302
|
+
return `traffic: tag ${String(t.tag)} is not a lowercase DNS label`;
|
|
303
|
+
return undefined;
|
|
304
|
+
}
|
|
305
|
+
/** What is wrong with a traffic list (CR5, CR13), or undefined. */
|
|
306
|
+
function trafficProblem(traffic, known) {
|
|
307
|
+
if (!Array.isArray(traffic))
|
|
308
|
+
return "traffic must be a list";
|
|
309
|
+
const targets = traffic;
|
|
310
|
+
const problem = targets.map((t) => targetProblem(t, known)).find((p) => p !== undefined);
|
|
311
|
+
if (problem)
|
|
312
|
+
return problem;
|
|
313
|
+
const tags = targets.flatMap((t) => (t.tag === undefined ? [] : [t.tag]));
|
|
314
|
+
if (new Set(tags).size !== tags.length)
|
|
315
|
+
return "traffic: a tag is used twice";
|
|
316
|
+
const sum = targets.reduce((n, t) => n + (t.percent ?? 0), 0);
|
|
317
|
+
return targets.length > 0 && sum !== 100 ? `traffic: percentages add up to ${sum}, not 100` : undefined;
|
|
318
|
+
}
|
|
319
|
+
function patchService(core, state, svc, url, body) {
|
|
320
|
+
const mask = maskOf(url);
|
|
321
|
+
if (mask instanceof Reply)
|
|
322
|
+
return mask;
|
|
323
|
+
const b = (body ?? {});
|
|
324
|
+
if (b.etag !== undefined && b.etag !== svc.etag)
|
|
325
|
+
return googleError(409, "ABORTED", "The etag does not match the service's: it was changed since it was read.");
|
|
326
|
+
const changesTemplate = mask.has("template") && JSON.stringify(b.template) !== JSON.stringify(svc.template);
|
|
327
|
+
const revision = changesTemplate ? newRevisionName(core, state, svc, b.template) : null;
|
|
328
|
+
if (revision instanceof Reply)
|
|
329
|
+
return revision;
|
|
330
|
+
const known = new Set(state.revisions.filter((r) => r.service === keyOf(svc)).map((r) => r.name).concat(revision ? [revision] : []));
|
|
331
|
+
const problem = mask.has("traffic") ? trafficProblem(b.traffic, known) : undefined;
|
|
332
|
+
if (problem)
|
|
333
|
+
return googleError(400, "INVALID_ARGUMENT", problem);
|
|
334
|
+
if (revision) {
|
|
335
|
+
const template = structuredClone(b.template);
|
|
336
|
+
state.revisions.push({ name: revision, service: keyOf(svc), template: structuredClone(template), state: "pending", createdBy: "api" });
|
|
337
|
+
svc.template = template;
|
|
338
|
+
svc.latestCreated = revision;
|
|
339
|
+
}
|
|
340
|
+
if (mask.has("traffic"))
|
|
341
|
+
svc.traffic = structuredClone(b.traffic);
|
|
342
|
+
bump(core, svc);
|
|
343
|
+
const op = { name: `projects/${svc.project}/locations/${svc.region}/operations/${core.nextId("op-")}`, service: keyOf(svc), revision, polls: state.operationPolls, done: false };
|
|
344
|
+
state.operations.push(op);
|
|
345
|
+
return new Reply(200, publicOperation(state, op));
|
|
346
|
+
}
|
|
347
|
+
function serviceAt(state, p) {
|
|
348
|
+
return state.services.find((s) => s.project === p.project && s.region === p.location && s.name === p.service);
|
|
349
|
+
}
|
|
350
|
+
const SERVICE = "/v2/projects/:project/locations/:location/services/:service";
|
|
351
|
+
const routes = router([
|
|
352
|
+
route("GET", SERVICE, ({ state, params }) => {
|
|
353
|
+
const svc = serviceAt(state, params);
|
|
354
|
+
if (!svc)
|
|
355
|
+
return notFound();
|
|
356
|
+
for (const op of state.operations)
|
|
357
|
+
if (op.service === keyOf(svc))
|
|
358
|
+
tick(state, op);
|
|
359
|
+
return new Reply(200, publicService(state, svc));
|
|
360
|
+
}),
|
|
361
|
+
route("PATCH", SERVICE, ({ core, state, params, url, body }) => {
|
|
362
|
+
const svc = serviceAt(state, params);
|
|
363
|
+
return svc ? patchService(core, state, svc, url, body) : notFound();
|
|
364
|
+
}),
|
|
365
|
+
route("GET", `${SERVICE}/revisions/:revision`, ({ state, params }) => {
|
|
366
|
+
const svc = serviceAt(state, params);
|
|
367
|
+
const rev = svc ? state.revisions.find((r) => r.service === keyOf(svc) && r.name === params.revision) : undefined;
|
|
368
|
+
return svc && rev ? new Reply(200, publicRevision(svc, rev)) : notFound();
|
|
369
|
+
}),
|
|
370
|
+
route("GET", "/v2/projects/:project/locations/:location/operations/:operation", ({ state, params }) => {
|
|
371
|
+
const op = state.operations.find((o) => o.name === `projects/${params.project}/locations/${params.location}/operations/${params.operation}`);
|
|
372
|
+
if (!op)
|
|
373
|
+
return notFound();
|
|
374
|
+
tick(state, op);
|
|
375
|
+
return new Reply(200, publicOperation(state, op));
|
|
376
|
+
}),
|
|
377
|
+
], notFound);
|
|
378
|
+
//# sourceMappingURL=cloud_run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G,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClH,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5E,CAAC,CAAC;IAEF,KAAK,CAAC,KAAK,EAAE,iEAAiE,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACpG,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,MAAM,CAAC,OAAO,cAAc,MAAM,CAAC,QAAQ,eAAe,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7I,IAAI,CAAC,EAAE;YAAE,OAAO,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChB,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC;CACH,EACD,QAAQ,CACT,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare const PROVIDERS: {
|
|
|
24
24
|
algolia: ProviderSim<import("./routes/algolia.js").AlgoliaState, import("./routes/algolia.js").AlgoliaSeed>;
|
|
25
25
|
xata: ProviderSim<import("./routes/xata.js").XataState, import("./routes/xata.js").XataSeed>;
|
|
26
26
|
digitalocean: ProviderSim<import("./routes/digitalocean.js").DigitaloceanState, import("./routes/digitalocean.js").DigitaloceanSeed>;
|
|
27
|
+
cloud_run: ProviderSim<import("./routes/cloud_run.js").CloudRunState, import("./routes/cloud_run.js").CloudRunSeed>;
|
|
27
28
|
};
|
|
28
29
|
type Providers = typeof PROVIDERS;
|
|
29
30
|
/** A simulated provider's name: its URL prefix, seed key and state key. */
|
package/dist/state.js
CHANGED
|
@@ -18,11 +18,12 @@ import { cloudflareSim } from "./routes/cloudflare.js";
|
|
|
18
18
|
import { algoliaSim } from "./routes/algolia.js";
|
|
19
19
|
import { xataSim } from "./routes/xata.js";
|
|
20
20
|
import { digitaloceanSim } from "./routes/digitalocean.js";
|
|
21
|
+
import { cloudRunSim } from "./routes/cloud_run.js";
|
|
21
22
|
/**
|
|
22
23
|
* Every simulated provider, by URL prefix (`/<name>/…`), drift prefix (`<name>.…`), seed key and state key.
|
|
23
24
|
* Order matters only for determinism: resets seed providers (and so allocate ids) in this order.
|
|
24
25
|
*/
|
|
25
|
-
export const PROVIDERS = { vercel: vercelSim, neon: neonSim, clerk: clerkSim, planetscale: planetscaleSim, launchdarkly: launchdarklySim, rest: restSim, supabase: supabaseSim, netlify: netlifySim, cloudflare: cloudflareSim, aws: awsSim, railway: railwaySim, fly: flySim, algolia: algoliaSim, xata: xataSim, digitalocean: digitaloceanSim };
|
|
26
|
+
export const PROVIDERS = { vercel: vercelSim, neon: neonSim, clerk: clerkSim, planetscale: planetscaleSim, launchdarkly: launchdarklySim, rest: restSim, supabase: supabaseSim, netlify: netlifySim, cloudflare: cloudflareSim, aws: awsSim, railway: railwaySim, fly: flySim, algolia: algoliaSim, xata: xataSim, digitalocean: digitaloceanSim, cloud_run: cloudRunSim };
|
|
26
27
|
/** The demo projects every provider starts with when a seed does not name it. */
|
|
27
28
|
export const DEFAULT_SEED = Object.fromEntries(Object.entries(PROVIDERS).map(([name, p]) => [name, p.defaultSeed]));
|
|
28
29
|
/** The registry as the core sees it: names and type-erased providers. */
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAyD,MAAM,YAAY,CAAC;AAEvH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAyD,MAAM,YAAY,CAAC;AAEvH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,E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