@substrat-run/contracts 0.219.0 → 0.221.0
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/calendar-source.d.ts +231 -0
- package/dist/calendar-source.d.ts.map +1 -0
- package/dist/calendar-source.js +158 -0
- package/dist/calendar-source.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +10 -2
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +22 -5
- package/dist/manifest.js.map +1 -1
- package/dist/operations.d.ts +8 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +11 -1
- package/dist/operations.js.map +1 -1
- package/dist/registry.d.ts +17 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +6 -0
- package/dist/registry.js.map +1 -1
- package/dist/routed-geo.d.ts +81 -0
- package/dist/routed-geo.d.ts.map +1 -0
- package/dist/routed-geo.js +101 -0
- package/dist/routed-geo.js.map +1 -0
- package/dist/source-build.d.ts +37 -0
- package/dist/source-build.d.ts.map +1 -1
- package/dist/source-build.js +14 -1
- package/dist/source-build.js.map +1 -1
- package/dist/vertical-connector.d.ts +75 -0
- package/dist/vertical-connector.d.ts.map +1 -1
- package/dist/vertical-connector.js +45 -9
- package/dist/vertical-connector.js.map +1 -1
- package/package.json +1 -1
package/dist/registry.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ export type VerticalOwnersReading = z.infer<typeof verticalOwnersReading>;
|
|
|
44
44
|
* `endsAt` is at least 90 days after `supersededAt`, the moment the next major was first served
|
|
45
45
|
* (K-65), later when the publisher stated so. What happens to an install still on it at that date
|
|
46
46
|
* is not decided (K-65, "Not decided here").
|
|
47
|
+
*
|
|
48
|
+
* `released` is the last release served into this major on its own script: the version the script
|
|
49
|
+
* ran before it, and when it landed. It is what the notice to an install on this major names as its
|
|
50
|
+
* update, with K-33's badge (K-65). Absent until a release lands into the major after it was
|
|
51
|
+
* superseded, and on an entry written before the field was recorded.
|
|
47
52
|
*/
|
|
48
53
|
export declare const earlierMajor: z.ZodObject<{
|
|
49
54
|
major: z.ZodNumber;
|
|
@@ -53,6 +58,10 @@ export declare const earlierMajor: z.ZodObject<{
|
|
|
53
58
|
migrationTag: z.ZodString;
|
|
54
59
|
supersededAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
55
60
|
endsAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
61
|
+
released: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
fromVersionId: z.ZodString;
|
|
63
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
64
|
+
}, z.core.$strip>>;
|
|
56
65
|
}, z.core.$strip>;
|
|
57
66
|
export type EarlierMajor = z.infer<typeof earlierMajor>;
|
|
58
67
|
/** The `verticals.earlier_majors` column's shape: oldest first. */
|
|
@@ -64,6 +73,10 @@ export declare const earlierMajors: z.ZodArray<z.ZodObject<{
|
|
|
64
73
|
migrationTag: z.ZodString;
|
|
65
74
|
supersededAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
66
75
|
endsAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
76
|
+
released: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
fromVersionId: z.ZodString;
|
|
78
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
79
|
+
}, z.core.$strip>>;
|
|
67
80
|
}, z.core.$strip>>;
|
|
68
81
|
/** K-65: the least a major is served after the next one is released. */
|
|
69
82
|
export declare const MAJOR_END_MIN_DAYS = 90;
|
|
@@ -158,6 +171,10 @@ export declare const vertical: z.ZodObject<{
|
|
|
158
171
|
migrationTag: z.ZodString;
|
|
159
172
|
supersededAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
160
173
|
endsAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
174
|
+
released: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
fromVersionId: z.ZodString;
|
|
176
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
177
|
+
}, z.core.$strip>>;
|
|
161
178
|
}, z.core.$strip>>>;
|
|
162
179
|
createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
163
180
|
}, z.core.$strip>;
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;iBAM9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,iGAAiG;AACjG,eAAO,MAAM,qBAAqB;;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;iBAM9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,iGAAiG;AACjG,eAAO,MAAM,qBAAqB;;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY;;;;;;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the moment the next major was first served
|
|
44
44
|
* (K-65), later when the publisher stated so. What happens to an install still on it at that date
|
|
45
45
|
* is not decided (K-65, "Not decided here").
|
|
46
|
+
*
|
|
47
|
+
* `released` is the last release served into this major on its own script: the version the script
|
|
48
|
+
* ran before it, and when it landed. It is what the notice to an install on this major names as its
|
|
49
|
+
* update, with K-33's badge (K-65). Absent until a release lands into the major after it was
|
|
50
|
+
* superseded, and on an entry written before the field was recorded.
|
|
46
51
|
*/
|
|
47
52
|
export const earlierMajor = z.object({
|
|
48
53
|
major: z.number().int().nonnegative(),
|
|
@@ -52,6 +57,7 @@ export const earlierMajor = z.object({
|
|
|
52
57
|
migrationTag: z.string().min(1),
|
|
53
58
|
supersededAt: instant,
|
|
54
59
|
endsAt: instant,
|
|
60
|
+
released: z.object({ fromVersionId: z.string().min(1), at: instant }).optional(),
|
|
55
61
|
});
|
|
56
62
|
/** The `verticals.earlier_majors` column's shape: oldest first. */
|
|
57
63
|
export const earlierMajors = z.array(earlierMajor);
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE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AAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAI,MAAsC,EAAE,MAAM,CAAC;IAC/D,OAAO,MAAM,KAAK,OAAO,CAAC,KAAK,IAAI,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAE,MAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGjH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,uBAAuB;CACxB,CAAC;AAGX,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,OAAO,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a routed request came from, as the router asserts it to the vertical (#3708).
|
|
3
|
+
*
|
|
4
|
+
* A dispatched worker runs untrusted and cannot read `request.cf`, so the edge's own idea of
|
|
5
|
+
* where a request comes from never reaches a hosted vertical. The router can read it, and it
|
|
6
|
+
* already strips every inbound `x-substrat-*` header before it sets its own: a header under that
|
|
7
|
+
* prefix is the router's word, in the same way `x-substrat-tenant` is. So the router asserts a
|
|
8
|
+
* small geo set under the prefix, and a vertical reads it beside the node it already trusts
|
|
9
|
+
* (`readRoutedGeo` in `@substrat-run/vertical-host`, which applies the router-secret check
|
|
10
|
+
* `readRoutedNode` applies).
|
|
11
|
+
*
|
|
12
|
+
* Coarse on purpose: a country, a region code and a continent. No city, no coordinates, no postal
|
|
13
|
+
* code, no network: nothing that narrows a person below a region. A vertical that needs more
|
|
14
|
+
* declares that need first; none can today.
|
|
15
|
+
*
|
|
16
|
+
* Each value is a CODE, not a name, because its readers compare it (a tax rate per country, an ad
|
|
17
|
+
* per region, a gate per continent), and a code is the same in every language:
|
|
18
|
+
*
|
|
19
|
+
* - `x-substrat-geo-country`: ISO 3166-1 alpha-2, upper case (`SE`). Cloudflare's `T1` (Tor)
|
|
20
|
+
* and `XX` (unknown) are not countries and are never asserted.
|
|
21
|
+
* - `x-substrat-geo-region`: ISO 3166-2, the country and its subdivision (`SE-AB`, `US-TX`).
|
|
22
|
+
* Only asserted beside a country.
|
|
23
|
+
* - `x-substrat-geo-continent`: one of `AF`, `AN`, `AS`, `EU`, `NA`, `OC`, `SA`.
|
|
24
|
+
*
|
|
25
|
+
* A value the edge did not know is a header not sent, and reads as `null`. The same normaliser
|
|
26
|
+
* judges what the router writes and what a reader reads, so a value that would not be written is
|
|
27
|
+
* never read either: a header sent twice (joined by the runtime as `SE, US`) is not a code and
|
|
28
|
+
* reads as `null`.
|
|
29
|
+
*
|
|
30
|
+
* Not `ClientGeo` (`client-context.ts`): that is a display shape, with the region's NAME and a
|
|
31
|
+
* city, built by a host that reads the edge itself. This is the routing contract, codes only.
|
|
32
|
+
*
|
|
33
|
+
* Pure and dependency-free (no zod), so a bundle that must stay small can carry it.
|
|
34
|
+
*/
|
|
35
|
+
/** ISO 3166-1 alpha-2 country of the client, as the edge located it. */
|
|
36
|
+
export declare const GEO_COUNTRY_HEADER = "x-substrat-geo-country";
|
|
37
|
+
/** ISO 3166-2 region code (`<country>-<subdivision>`) of the client. */
|
|
38
|
+
export declare const GEO_REGION_HEADER = "x-substrat-geo-region";
|
|
39
|
+
/** Two-letter continent code of the client. */
|
|
40
|
+
export declare const GEO_CONTINENT_HEADER = "x-substrat-geo-continent";
|
|
41
|
+
/** The three geo headers the router asserts, in the order it writes them. */
|
|
42
|
+
export declare const ROUTED_GEO_HEADERS: readonly ["x-substrat-geo-country", "x-substrat-geo-region", "x-substrat-geo-continent"];
|
|
43
|
+
/** The continents Cloudflare reports, by their two-letter codes. */
|
|
44
|
+
export declare const GEO_CONTINENTS: readonly ["AF", "AN", "AS", "EU", "NA", "OC", "SA"];
|
|
45
|
+
export type GeoContinent = (typeof GEO_CONTINENTS)[number];
|
|
46
|
+
/** The router's coarse geo for one request. Every field is `null` when the edge did not say. */
|
|
47
|
+
export interface RoutedGeo {
|
|
48
|
+
/** ISO 3166-1 alpha-2 (`SE`). */
|
|
49
|
+
readonly country: string | null;
|
|
50
|
+
/** ISO 3166-2 (`SE-AB`); never set without `country`, and always starts with it. */
|
|
51
|
+
readonly region: string | null;
|
|
52
|
+
readonly continent: GeoContinent | null;
|
|
53
|
+
}
|
|
54
|
+
export declare const EMPTY_ROUTED_GEO: RoutedGeo;
|
|
55
|
+
/** What a normaliser accepts: anything, field by field, as an edge or a header might hand it over. */
|
|
56
|
+
export interface RoutedGeoInput {
|
|
57
|
+
readonly country?: unknown;
|
|
58
|
+
/** A full ISO 3166-2 code (`SE-AB`), or only the subdivision part (`AB`), which is joined to `country`. */
|
|
59
|
+
readonly region?: unknown;
|
|
60
|
+
readonly continent?: unknown;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The geo the router may assert, from whatever an edge or a test hands over: each field kept only
|
|
64
|
+
* when it is a code of its kind, so the result is always one a reader accepts back unchanged.
|
|
65
|
+
*/
|
|
66
|
+
export declare function routedGeo(input: RoutedGeoInput | null | undefined): RoutedGeo;
|
|
67
|
+
/**
|
|
68
|
+
* The headers that assert `geo`, by name: only the fields that normalise to a code. The router
|
|
69
|
+
* writes exactly these, and a local test or dev request that wants a deterministic geo sets
|
|
70
|
+
* exactly these too.
|
|
71
|
+
*/
|
|
72
|
+
export declare function routedGeoHeaders(geo: RoutedGeoInput | null | undefined): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* The geo the headers assert, judged by the same normaliser the router writes with. It says
|
|
75
|
+
* nothing about WHO set them: call it only on a request whose `x-substrat-*` headers are the
|
|
76
|
+
* router's, which is what `readRoutedGeo` in `@substrat-run/vertical-host` checks first.
|
|
77
|
+
*/
|
|
78
|
+
export declare function routedGeoFromHeaders(headers: {
|
|
79
|
+
get(name: string): string | null;
|
|
80
|
+
}): RoutedGeo;
|
|
81
|
+
//# sourceMappingURL=routed-geo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed-geo.d.ts","sourceRoot":"","sources":["../src/routed-geo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,0FAAwF,CAAC;AAExH,oEAAoE;AACpE,eAAO,MAAM,cAAc,qDAAqE,CAAC;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,gBAAgB,EAAE,SAA2E,CAAC;AAE3G,sGAAsG;AACtG,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,2GAA2G;IAC3G,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAUD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAc7E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/F;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAM7F"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a routed request came from, as the router asserts it to the vertical (#3708).
|
|
3
|
+
*
|
|
4
|
+
* A dispatched worker runs untrusted and cannot read `request.cf`, so the edge's own idea of
|
|
5
|
+
* where a request comes from never reaches a hosted vertical. The router can read it, and it
|
|
6
|
+
* already strips every inbound `x-substrat-*` header before it sets its own: a header under that
|
|
7
|
+
* prefix is the router's word, in the same way `x-substrat-tenant` is. So the router asserts a
|
|
8
|
+
* small geo set under the prefix, and a vertical reads it beside the node it already trusts
|
|
9
|
+
* (`readRoutedGeo` in `@substrat-run/vertical-host`, which applies the router-secret check
|
|
10
|
+
* `readRoutedNode` applies).
|
|
11
|
+
*
|
|
12
|
+
* Coarse on purpose: a country, a region code and a continent. No city, no coordinates, no postal
|
|
13
|
+
* code, no network: nothing that narrows a person below a region. A vertical that needs more
|
|
14
|
+
* declares that need first; none can today.
|
|
15
|
+
*
|
|
16
|
+
* Each value is a CODE, not a name, because its readers compare it (a tax rate per country, an ad
|
|
17
|
+
* per region, a gate per continent), and a code is the same in every language:
|
|
18
|
+
*
|
|
19
|
+
* - `x-substrat-geo-country`: ISO 3166-1 alpha-2, upper case (`SE`). Cloudflare's `T1` (Tor)
|
|
20
|
+
* and `XX` (unknown) are not countries and are never asserted.
|
|
21
|
+
* - `x-substrat-geo-region`: ISO 3166-2, the country and its subdivision (`SE-AB`, `US-TX`).
|
|
22
|
+
* Only asserted beside a country.
|
|
23
|
+
* - `x-substrat-geo-continent`: one of `AF`, `AN`, `AS`, `EU`, `NA`, `OC`, `SA`.
|
|
24
|
+
*
|
|
25
|
+
* A value the edge did not know is a header not sent, and reads as `null`. The same normaliser
|
|
26
|
+
* judges what the router writes and what a reader reads, so a value that would not be written is
|
|
27
|
+
* never read either: a header sent twice (joined by the runtime as `SE, US`) is not a code and
|
|
28
|
+
* reads as `null`.
|
|
29
|
+
*
|
|
30
|
+
* Not `ClientGeo` (`client-context.ts`): that is a display shape, with the region's NAME and a
|
|
31
|
+
* city, built by a host that reads the edge itself. This is the routing contract, codes only.
|
|
32
|
+
*
|
|
33
|
+
* Pure and dependency-free (no zod), so a bundle that must stay small can carry it.
|
|
34
|
+
*/
|
|
35
|
+
/** ISO 3166-1 alpha-2 country of the client, as the edge located it. */
|
|
36
|
+
export const GEO_COUNTRY_HEADER = 'x-substrat-geo-country';
|
|
37
|
+
/** ISO 3166-2 region code (`<country>-<subdivision>`) of the client. */
|
|
38
|
+
export const GEO_REGION_HEADER = 'x-substrat-geo-region';
|
|
39
|
+
/** Two-letter continent code of the client. */
|
|
40
|
+
export const GEO_CONTINENT_HEADER = 'x-substrat-geo-continent';
|
|
41
|
+
/** The three geo headers the router asserts, in the order it writes them. */
|
|
42
|
+
export const ROUTED_GEO_HEADERS = Object.freeze([GEO_COUNTRY_HEADER, GEO_REGION_HEADER, GEO_CONTINENT_HEADER]);
|
|
43
|
+
/** The continents Cloudflare reports, by their two-letter codes. */
|
|
44
|
+
export const GEO_CONTINENTS = Object.freeze(['AF', 'AN', 'AS', 'EU', 'NA', 'OC', 'SA']);
|
|
45
|
+
export const EMPTY_ROUTED_GEO = Object.freeze({ country: null, region: null, continent: null });
|
|
46
|
+
const COUNTRY = /^[A-Z]{2}$/;
|
|
47
|
+
const NOT_A_COUNTRY = new Set(['T1', 'XX']);
|
|
48
|
+
/** ISO 3166-2's subdivision part: one to three letters or digits. */
|
|
49
|
+
const SUBDIVISION = /^[A-Z0-9]{1,3}$/;
|
|
50
|
+
const CONTINENTS = new Set(GEO_CONTINENTS);
|
|
51
|
+
const code = (value) => (typeof value === 'string' && value.trim() !== '' ? value.trim().toUpperCase() : null);
|
|
52
|
+
/**
|
|
53
|
+
* The geo the router may assert, from whatever an edge or a test hands over: each field kept only
|
|
54
|
+
* when it is a code of its kind, so the result is always one a reader accepts back unchanged.
|
|
55
|
+
*/
|
|
56
|
+
export function routedGeo(input) {
|
|
57
|
+
if (!input)
|
|
58
|
+
return EMPTY_ROUTED_GEO;
|
|
59
|
+
const rawCountry = code(input.country);
|
|
60
|
+
const country = rawCountry && COUNTRY.test(rawCountry) && !NOT_A_COUNTRY.has(rawCountry) ? rawCountry : null;
|
|
61
|
+
const rawRegion = code(input.region);
|
|
62
|
+
let region = null;
|
|
63
|
+
if (country && rawRegion) {
|
|
64
|
+
const dash = rawRegion.indexOf('-');
|
|
65
|
+
const subdivision = dash === -1 ? rawRegion : rawRegion.slice(0, dash) === country ? rawRegion.slice(dash + 1) : null;
|
|
66
|
+
if (subdivision && SUBDIVISION.test(subdivision))
|
|
67
|
+
region = `${country}-${subdivision}`;
|
|
68
|
+
}
|
|
69
|
+
const rawContinent = code(input.continent);
|
|
70
|
+
const continent = rawContinent && CONTINENTS.has(rawContinent) ? rawContinent : null;
|
|
71
|
+
return { country, region, continent };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The headers that assert `geo`, by name: only the fields that normalise to a code. The router
|
|
75
|
+
* writes exactly these, and a local test or dev request that wants a deterministic geo sets
|
|
76
|
+
* exactly these too.
|
|
77
|
+
*/
|
|
78
|
+
export function routedGeoHeaders(geo) {
|
|
79
|
+
const { country, region, continent } = routedGeo(geo);
|
|
80
|
+
const headers = {};
|
|
81
|
+
if (country)
|
|
82
|
+
headers[GEO_COUNTRY_HEADER] = country;
|
|
83
|
+
if (region)
|
|
84
|
+
headers[GEO_REGION_HEADER] = region;
|
|
85
|
+
if (continent)
|
|
86
|
+
headers[GEO_CONTINENT_HEADER] = continent;
|
|
87
|
+
return headers;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The geo the headers assert, judged by the same normaliser the router writes with. It says
|
|
91
|
+
* nothing about WHO set them: call it only on a request whose `x-substrat-*` headers are the
|
|
92
|
+
* router's, which is what `readRoutedGeo` in `@substrat-run/vertical-host` checks first.
|
|
93
|
+
*/
|
|
94
|
+
export function routedGeoFromHeaders(headers) {
|
|
95
|
+
return routedGeo({
|
|
96
|
+
country: headers.get(GEO_COUNTRY_HEADER),
|
|
97
|
+
region: headers.get(GEO_REGION_HEADER),
|
|
98
|
+
continent: headers.get(GEO_CONTINENT_HEADER),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=routed-geo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed-geo.js","sourceRoot":"","sources":["../src/routed-geo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAC3D,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,CAAU,CAAC,CAAC;AAExH,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC,CAAC;AAYjG,MAAM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CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
|
package/dist/source-build.d.ts
CHANGED
|
@@ -91,6 +91,28 @@ export declare const sourceBuildResult: z.ZodObject<{
|
|
|
91
91
|
ms: z.ZodNumber;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
93
|
}, z.core.$strip>;
|
|
94
|
+
/**
|
|
95
|
+
* The builder's answer to a build it accepted without a waiting client (#2951): the id its record
|
|
96
|
+
* is read by. The build then runs by itself to an outcome on that record.
|
|
97
|
+
*/
|
|
98
|
+
export declare const sourceBuildAccepted: z.ZodObject<{
|
|
99
|
+
buildId: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
export type SourceBuildAccepted = z.infer<typeof sourceBuildAccepted>;
|
|
102
|
+
/**
|
|
103
|
+
* The version an accepted build's release became, as the control plane answered the builder's
|
|
104
|
+
* hand-over (#2951): its id, and its admission when published. A private vertical's version admits
|
|
105
|
+
* itself; any other waits for the admit checkpoint, as a waited-for push's does.
|
|
106
|
+
*/
|
|
107
|
+
export declare const sourceBuildPublished: z.ZodObject<{
|
|
108
|
+
versionId: z.ZodString;
|
|
109
|
+
admission: z.ZodEnum<{
|
|
110
|
+
admitted: "admitted";
|
|
111
|
+
pending: "pending";
|
|
112
|
+
rejected: "rejected";
|
|
113
|
+
}>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type SourceBuildPublished = z.infer<typeof sourceBuildPublished>;
|
|
94
116
|
export interface ProjectRecord {
|
|
95
117
|
id: string;
|
|
96
118
|
slug: string;
|
|
@@ -134,6 +156,14 @@ export declare const sourceBuildRecord: z.ZodObject<{
|
|
|
134
156
|
}, z.core.$strip>>;
|
|
135
157
|
detail: z.ZodOptional<z.ZodString>;
|
|
136
158
|
interruption: z.ZodOptional<z.ZodString>;
|
|
159
|
+
published: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
versionId: z.ZodString;
|
|
161
|
+
admission: z.ZodEnum<{
|
|
162
|
+
admitted: "admitted";
|
|
163
|
+
pending: "pending";
|
|
164
|
+
rejected: "rejected";
|
|
165
|
+
}>;
|
|
166
|
+
}, z.core.$strip>>;
|
|
137
167
|
}, z.core.$strip>;
|
|
138
168
|
export type SourceBuildRecord = z.infer<typeof sourceBuildRecord>;
|
|
139
169
|
/**
|
|
@@ -154,6 +184,13 @@ export interface SourceBuildService {
|
|
|
154
184
|
*/
|
|
155
185
|
toolchain?(): Promise<SourceBuilderToolchain | null>;
|
|
156
186
|
build(tenantId: string, slug: string, request: SourceBuildRequest): Promise<BuiltSource>;
|
|
187
|
+
/**
|
|
188
|
+
* Accepts a build of a pinned revision and answers at once; the build runs to an outcome on its
|
|
189
|
+
* record (`record`) with nobody waiting (#2951). Once built, the builder keeps the release and
|
|
190
|
+
* hands it to the control plane, which publishes it as a deploy does and meters its minutes.
|
|
191
|
+
* Optional: a service from before it has none.
|
|
192
|
+
*/
|
|
193
|
+
accept?(tenantId: string, slug: string, request: SourceBuildRequest): Promise<SourceBuildAccepted>;
|
|
157
194
|
projects(tenantId: string, request: Request): Promise<Response>;
|
|
158
195
|
/** Null when the tenant's builder holds no record of that build. */
|
|
159
196
|
record(tenantId: string, buildId: string): Promise<SourceBuildRecord | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-build.d.ts","sourceRoot":"","sources":["../src/source-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AACjD,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,4MACwK,CAAC;AAE5M,wFAAwF;AACxF,eAAO,MAAM,UAAU,aAItB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED,eAAO,MAAM,UAAU;;;;kBA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AM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChE,oEAAoE;IACpE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC7E,gHAAgH;IAChH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACjE"}
|
package/dist/source-build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { versionOrigin } from './registry.js';
|
|
2
|
+
import { admissionStatus, versionOrigin } from './registry.js';
|
|
3
3
|
export const SOURCE_BYTES_MAX = 48 * 1024 * 1024;
|
|
4
4
|
export const SOURCE_FILES_MAX = 20_000;
|
|
5
5
|
/**
|
|
@@ -74,6 +74,17 @@ export const sourceBuildResult = z.object({
|
|
|
74
74
|
/** What the build's meter records (#2946): the time it worked, queue left out. A builder older than this sends none. */
|
|
75
75
|
usage: z.object({ buildId: z.string().min(1), ms: z.number().int().nonnegative() }).optional(),
|
|
76
76
|
});
|
|
77
|
+
/**
|
|
78
|
+
* The builder's answer to a build it accepted without a waiting client (#2951): the id its record
|
|
79
|
+
* is read by. The build then runs by itself to an outcome on that record.
|
|
80
|
+
*/
|
|
81
|
+
export const sourceBuildAccepted = z.object({ buildId: z.string().min(1) });
|
|
82
|
+
/**
|
|
83
|
+
* The version an accepted build's release became, as the control plane answered the builder's
|
|
84
|
+
* hand-over (#2951): its id, and its admission when published. A private vertical's version admits
|
|
85
|
+
* itself; any other waits for the admit checkpoint, as a waited-for push's does.
|
|
86
|
+
*/
|
|
87
|
+
export const sourceBuildPublished = z.object({ versionId: z.string().min(1), admission: admissionStatus });
|
|
77
88
|
/**
|
|
78
89
|
* A hosted build's own record, as the builder stores it (#2931). `interrupted` is a build the
|
|
79
90
|
* agent never answered for; `slug` is null when it stopped before writing a record of its own.
|
|
@@ -89,6 +100,8 @@ export const sourceBuildRecord = z.object({
|
|
|
89
100
|
})),
|
|
90
101
|
detail: z.string().optional(),
|
|
91
102
|
interruption: z.string().optional(),
|
|
103
|
+
/** An accepted build's release, once the control plane published it. Absent on a waited-for build. */
|
|
104
|
+
published: sourceBuildPublished.optional(),
|
|
92
105
|
});
|
|
93
106
|
/**
|
|
94
107
|
* The packages a hosted build runs with (#3503). A source build runs the CLI and contracts the
|
package/dist/source-build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-build.js","sourceRoot":"","sources":["../src/source-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"source-build.js","sourceRoot":"","sources":["../src/source-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACjC,yMAAyM,CAAC;AAE5M,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAC1D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;IACvD,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAA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AAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B,CAAC,CAAC"}
|
|
@@ -361,6 +361,13 @@ export declare const connectorScriptConfig: z.ZodRecord<z.ZodString, z.ZodString
|
|
|
361
361
|
* The same call, made to a first-party connector deployed as its own platform script rather than
|
|
362
362
|
* run inside the control plane (docs/rfc/connector-scripts.md). The response is
|
|
363
363
|
* `connectorCallResponse`, unchanged.
|
|
364
|
+
*
|
|
365
|
+
* `config` rides on the probes and, since #3377, on the two scoped roles a first-party connector
|
|
366
|
+
* needs the deployment's configuration for, so each is answered from the call alone rather than from
|
|
367
|
+
* configuration handed beside it: `dispatch` (which provider environment a lookup reaches) and `sweep`
|
|
368
|
+
* (which provider hosts one scope's poll reads, and the consent it is held to). Optional on each, so
|
|
369
|
+
* a call that carries none parses as before. A vertical's call carries none: it has no deployment
|
|
370
|
+
* configuration of its own.
|
|
364
371
|
*/
|
|
365
372
|
export declare const connectorScriptCallRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
366
373
|
role: z.ZodLiteral<"probe-candidate">;
|
|
@@ -422,6 +429,7 @@ export declare const connectorScriptCallRequest: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
422
429
|
key: z.ZodString;
|
|
423
430
|
value: z.ZodUnknown;
|
|
424
431
|
}, z.core.$strict>>;
|
|
432
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
425
433
|
}, z.core.$strict>, z.ZodObject<{
|
|
426
434
|
role: z.ZodLiteral<"sweep-connection">;
|
|
427
435
|
provider: z.ZodString;
|
|
@@ -512,12 +520,61 @@ export declare const connectorScriptCallRequest: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
512
520
|
key: z.ZodString;
|
|
513
521
|
value: z.ZodUnknown;
|
|
514
522
|
}, z.core.$strict>>;
|
|
523
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
515
524
|
}, z.core.$strict>], "role">;
|
|
516
525
|
export type ConnectorScriptCallRequest = z.infer<typeof connectorScriptCallRequest>;
|
|
517
526
|
/**
|
|
518
527
|
* The vertical's answer. On `ok: false` no state write is applied; `refused` says the connector
|
|
519
528
|
* threw `ConnectorRefusal` (terminal) rather than failing in a way worth retrying.
|
|
529
|
+
*
|
|
530
|
+
* A failure may also say what the platform reads off a throw (#3377), so a connector that answers
|
|
531
|
+
* rather than throws loses nothing the drain decides from:
|
|
532
|
+
*
|
|
533
|
+
* - `status` — the HTTP status the failure carried: the provider's answer, or the problem
|
|
534
|
+
* catalog's for one of ours. What decides a dispatch's terminality (a non-retryable 4xx).
|
|
535
|
+
* - `origin` — who refused (#841): `platform` before anything reached the provider, `provider`
|
|
536
|
+
* when it answered and refused, `unknown` when the two could not be told apart.
|
|
537
|
+
* - `code` — the taxonomy code of a `platform` refusal, so it can be said precisely.
|
|
538
|
+
*
|
|
539
|
+
* All three are optional and absent on an answer written before they existed, which the platform
|
|
540
|
+
* reads as it always did: a failure with no status, attributed by no one.
|
|
520
541
|
*/
|
|
542
|
+
export declare const connectorCallFailure: z.ZodObject<{
|
|
543
|
+
ok: z.ZodLiteral<false>;
|
|
544
|
+
refused: z.ZodBoolean;
|
|
545
|
+
error: z.ZodString;
|
|
546
|
+
uses: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
547
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
548
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
549
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
550
|
+
ok: z.ZodLiteral<true>;
|
|
551
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
552
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
553
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
554
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
555
|
+
ok: z.ZodLiteral<false>;
|
|
556
|
+
error: z.ZodString;
|
|
557
|
+
}, z.core.$strict>], "ok">>;
|
|
558
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
559
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
560
|
+
platform: "platform";
|
|
561
|
+
provider: "provider";
|
|
562
|
+
unknown: "unknown";
|
|
563
|
+
}>>;
|
|
564
|
+
code: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
conflict: "conflict";
|
|
566
|
+
forbidden: "forbidden";
|
|
567
|
+
internal: "internal";
|
|
568
|
+
not_found: "not_found";
|
|
569
|
+
permission_denied: "permission_denied";
|
|
570
|
+
precondition_failed: "precondition_failed";
|
|
571
|
+
rate_limited: "rate_limited";
|
|
572
|
+
unauthenticated: "unauthenticated";
|
|
573
|
+
unavailable: "unavailable";
|
|
574
|
+
validation_failed: "validation_failed";
|
|
575
|
+
}>>;
|
|
576
|
+
}, z.core.$strict>;
|
|
577
|
+
export type ConnectorCallFailure = z.infer<typeof connectorCallFailure>;
|
|
521
578
|
export declare const connectorCallResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
522
579
|
ok: z.ZodLiteral<true>;
|
|
523
580
|
result: z.ZodUnknown;
|
|
@@ -553,6 +610,24 @@ export declare const connectorCallResponse: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
553
610
|
ok: z.ZodLiteral<false>;
|
|
554
611
|
error: z.ZodString;
|
|
555
612
|
}, z.core.$strict>], "ok">>;
|
|
613
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
614
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
615
|
+
platform: "platform";
|
|
616
|
+
provider: "provider";
|
|
617
|
+
unknown: "unknown";
|
|
618
|
+
}>>;
|
|
619
|
+
code: z.ZodOptional<z.ZodEnum<{
|
|
620
|
+
conflict: "conflict";
|
|
621
|
+
forbidden: "forbidden";
|
|
622
|
+
internal: "internal";
|
|
623
|
+
not_found: "not_found";
|
|
624
|
+
permission_denied: "permission_denied";
|
|
625
|
+
precondition_failed: "precondition_failed";
|
|
626
|
+
rate_limited: "rate_limited";
|
|
627
|
+
unauthenticated: "unauthenticated";
|
|
628
|
+
unavailable: "unavailable";
|
|
629
|
+
validation_failed: "validation_failed";
|
|
630
|
+
}>>;
|
|
556
631
|
}, z.core.$strict>], "ok">;
|
|
557
632
|
export type ConnectorCallResponse = z.infer<typeof connectorCallResponse>;
|
|
558
633
|
/** `result` of a `sweep` call. A `probe` or `probe-candidate` call answers `connectionProbe`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-connector.d.ts","sourceRoot":"","sources":["../src/vertical-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"vertical-connector.d.ts","sourceRoot":"","sources":["../src/vertical-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;GASG;AAEH,yFAAyF;AACzF,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErE;AAED,eAAO,MAAM,yBAAyB,aAGrC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;kBASxB,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCrC,CAAC;AACL,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF,eAAO,MAAM,6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