@geekmidas/manifest 10.0.0-alpha.2 → 10.0.0-alpha.21
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.cjs +49 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -109
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +59 -109
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +49 -66
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -169,7 +169,7 @@ type PostgresVersion = 13 | 14 | 15 | 16 | 17 | 18;
|
|
|
169
169
|
* from a developer's machine for a reason neither could see. Both now read
|
|
170
170
|
* this.
|
|
171
171
|
*/
|
|
172
|
-
declare const DEFAULT_POSTGRES_VERSION: PostgresVersion;
|
|
172
|
+
export declare const DEFAULT_POSTGRES_VERSION: PostgresVersion;
|
|
173
173
|
interface DatabaseDeclaration extends Node {
|
|
174
174
|
kind: 'database';
|
|
175
175
|
engine?: 'postgres';
|
|
@@ -319,21 +319,15 @@ interface CacheDeclaration extends Node {
|
|
|
319
319
|
interface RestApiDeclaration extends Node {
|
|
320
320
|
kind: 'rest-api';
|
|
321
321
|
/**
|
|
322
|
-
*
|
|
323
|
-
* root — the same thing a `site` says, for the same reason.
|
|
322
|
+
* The app that serves this surface, relative to the workspace root.
|
|
324
323
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
* one app then had to share one container, which is how an auth server ended
|
|
329
|
-
* up mounted into an API by a hook.
|
|
330
|
-
*
|
|
331
|
-
* Optional, and its absence is meaningful: a surface with no app of its own
|
|
332
|
-
* is served by the surface that named it — an auth server mounted into the
|
|
333
|
-
* API that called `.auth()` on it, rather than a second container nobody
|
|
334
|
-
* asked for.
|
|
324
|
+
* Required, and the only thing about its process a surface says: its code
|
|
325
|
+
* is found through the workspace's `constructs` glob, and ports are
|
|
326
|
+
* assigned in a stable order. Nothing infers it from the id.
|
|
335
327
|
*/
|
|
336
|
-
|
|
328
|
+
path: string;
|
|
329
|
+
/** Whether this surface streams into a Telescope. */
|
|
330
|
+
telescope?: true;
|
|
337
331
|
/**
|
|
338
332
|
* The construct that authenticates this surface.
|
|
339
333
|
*
|
|
@@ -424,63 +418,16 @@ type Glob = string | readonly string[];
|
|
|
424
418
|
* process means one of them has the spec and the other collapses onto it —
|
|
425
419
|
* which is the same rule that decides deploy units, now stated once.
|
|
426
420
|
*/
|
|
427
|
-
/**
|
|
428
|
-
* Where an app's code lives when nobody says otherwise.
|
|
429
|
-
*
|
|
430
|
-
* One glob, every kind — the same rule the `constructs` glob follows. A handler
|
|
431
|
-
* in one of these directories is found; anywhere else needs a `code` glob, and
|
|
432
|
-
* saying so is the whole reason the field still exists.
|
|
433
|
-
*/
|
|
434
|
-
declare const DEFAULT_APP_CODE = "./{endpoints,functions,crons,queues,topics,subscribers}/**/*.ts";
|
|
435
421
|
interface AppSpec {
|
|
436
|
-
/**
|
|
437
|
-
|
|
438
|
-
*
|
|
439
|
-
* Optional, and normally omitted: `apps/<kebab-id>` when that directory
|
|
440
|
-
* exists, and the workspace root otherwise. An `Api` construct in a
|
|
441
|
-
* monorepo means `apps/api`, and in a single-app project it means `.` —
|
|
442
|
-
* both of which are answerable by looking, which is why neither was worth
|
|
443
|
-
* making someone write down.
|
|
444
|
-
*
|
|
445
|
-
* Set one only when the layout is genuinely different, e.g.
|
|
446
|
-
* `path: 'services/api'`.
|
|
447
|
-
*/
|
|
448
|
-
path?: string;
|
|
422
|
+
/** Where its source lives, relative to the workspace root. */
|
|
423
|
+
path: string;
|
|
449
424
|
/**
|
|
450
425
|
* The port it answers on locally.
|
|
451
426
|
*
|
|
452
427
|
* Optional, and normally omitted: ports are assigned in a stable order so
|
|
453
|
-
* that adding a site does not renumber the others.
|
|
454
|
-
* something outside the workspace has to know it in advance.
|
|
428
|
+
* that adding a site does not renumber the others.
|
|
455
429
|
*/
|
|
456
430
|
port?: number;
|
|
457
|
-
/**
|
|
458
|
-
* One glob that finds everything this app defines, relative to `path`.
|
|
459
|
-
*
|
|
460
|
-
* Every export of every matching module is inspected, and each kind is
|
|
461
|
-
* picked out by whatever recognises it — the same rule the `constructs`
|
|
462
|
-
* glob already follows. A glob per kind was the specialness this model
|
|
463
|
-
* removes: five patterns that had to be kept in step, where a handler in the
|
|
464
|
-
* wrong directory simply never loaded and nothing said so.
|
|
465
|
-
*
|
|
466
|
-
* The per-kind fields below still work, and still win where both are given,
|
|
467
|
-
* because a single-app `defineConfig` has always been written that way.
|
|
468
|
-
*
|
|
469
|
-
* Optional, and normally omitted: the conventional directories under
|
|
470
|
-
* `path`, which is `DEFAULT_APP_CODE`. A glob is worth writing only when
|
|
471
|
-
* the code is somewhere else.
|
|
472
|
-
*/
|
|
473
|
-
code?: Glob;
|
|
474
|
-
/** Globs that find one kind of thing. Prefer `code`. */
|
|
475
|
-
routes?: Glob;
|
|
476
|
-
functions?: Glob;
|
|
477
|
-
crons?: Glob;
|
|
478
|
-
queues?: Glob;
|
|
479
|
-
topics?: Glob;
|
|
480
|
-
subscribers?: Glob;
|
|
481
|
-
/** `./config/env#envParser` — module, optionally with an export. */
|
|
482
|
-
envParser?: string;
|
|
483
|
-
logger?: string;
|
|
484
431
|
telescope?: string | boolean | Record<string, unknown>;
|
|
485
432
|
studio?: string | boolean | Record<string, unknown>;
|
|
486
433
|
openapi?: boolean | Record<string, unknown>;
|
|
@@ -516,10 +463,9 @@ interface SiteDeclaration extends Node {
|
|
|
516
463
|
/**
|
|
517
464
|
* How it is built and run, `path` included.
|
|
518
465
|
*
|
|
519
|
-
* Required
|
|
520
|
-
* There is no arrangement in which two sites are one process.
|
|
466
|
+
* Required: a site is always its own app, and says where it lives.
|
|
521
467
|
*/
|
|
522
|
-
app
|
|
468
|
+
app: AppSpec;
|
|
523
469
|
/**
|
|
524
470
|
* Whether this is the site the base domain points at.
|
|
525
471
|
*
|
|
@@ -555,10 +501,14 @@ interface SiteDeclaration extends Node {
|
|
|
555
501
|
interface WorkerDeclaration extends Node {
|
|
556
502
|
kind: 'worker';
|
|
557
503
|
/**
|
|
558
|
-
*
|
|
559
|
-
*
|
|
504
|
+
* A worker declares no app, because it is not one.
|
|
505
|
+
*
|
|
506
|
+
* It names the process that runs a cron, a subscriber or a queue consumer —
|
|
507
|
+
* and that process is the app's server, the same one the endpoints run in,
|
|
508
|
+
* without an HTTP surface of its own. Giving it a path made it a second
|
|
509
|
+
* container to build, deploy and keep alive for work that was already going
|
|
510
|
+
* to run somewhere.
|
|
560
511
|
*/
|
|
561
|
-
app?: AppSpec;
|
|
562
512
|
/** Surfaces and resources it calls, which is what grants it access. */
|
|
563
513
|
dependencies?: readonly Dependency[];
|
|
564
514
|
}
|
|
@@ -664,7 +614,7 @@ type DerivedKind = DerivedDeclaration['kind'];
|
|
|
664
614
|
* start. There is no `writer` — the database *is* the writer, which is what
|
|
665
615
|
* keeps a replica from being reached by accident.
|
|
666
616
|
*/
|
|
667
|
-
declare const DERIVES_FROM: Readonly<Record<DerivedKind, readonly string[]>>;
|
|
617
|
+
export declare const DERIVES_FROM: Readonly<Record<DerivedKind, readonly string[]>>;
|
|
668
618
|
type DeclarationKind = Declaration['kind'];
|
|
669
619
|
/**
|
|
670
620
|
* The manifest: every construct keyed by its id.
|
|
@@ -694,13 +644,13 @@ type IdsOf<M extends ConstructManifest> = Extract<keyof M, string>;
|
|
|
694
644
|
/** The declaration for one id. */
|
|
695
645
|
type DeclarationOf<M extends ConstructManifest, K extends IdsOf<M>> = M[K];
|
|
696
646
|
/** Every id of a given kind — what an adapter iterates when provisioning. */
|
|
697
|
-
type IdsOfKind<M extends ConstructManifest, K extends DeclarationKind> = { [Id in IdsOf<M>]: M[Id]['kind'] extends K ? Id : never }[IdsOf<M>];
|
|
647
|
+
type IdsOfKind<M extends ConstructManifest, K extends DeclarationKind> = { [Id in IdsOf<M>]: M[Id]['kind'] extends K ? Id : never; }[IdsOf<M>];
|
|
698
648
|
/** The env keys one construct provides. */
|
|
699
649
|
type ProvidedKeys<M extends ConstructManifest, K extends IdsOf<M>> = M[K] extends {
|
|
700
650
|
provides: readonly (infer P)[];
|
|
701
651
|
} ? P : never;
|
|
702
652
|
/** Every env key any construct in the manifest provides. */
|
|
703
|
-
type AllProvidedKeys<M extends ConstructManifest> = { [Id in IdsOf<M>]: ProvidedKeys<M, Id
|
|
653
|
+
type AllProvidedKeys<M extends ConstructManifest> = { [Id in IdsOf<M>]: ProvidedKeys<M, Id>; }[IdsOf<M>];
|
|
704
654
|
/**
|
|
705
655
|
* What each kind provides, by role rather than by provider syntax.
|
|
706
656
|
*
|
|
@@ -814,6 +764,11 @@ interface ProvidesByKind {
|
|
|
814
764
|
issuer: string;
|
|
815
765
|
audience: string;
|
|
816
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* A worker is reached by nothing — it reaches out, to a queue, a schedule,
|
|
769
|
+
* a topic. So it publishes no address, the way a cron does not.
|
|
770
|
+
*/
|
|
771
|
+
worker: Record<never, never>;
|
|
817
772
|
}
|
|
818
773
|
type Provides<K extends keyof ProvidesByKind> = ProvidesByKind[K];
|
|
819
774
|
/**
|
|
@@ -823,11 +778,11 @@ type Provides<K extends keyof ProvidesByKind> = ProvidesByKind[K];
|
|
|
823
778
|
* is not a restriction on what may be depended on, since a server-side consumer
|
|
824
779
|
* can legitimately use any of them. A bucket's `url` presigns and stays private.
|
|
825
780
|
*/
|
|
826
|
-
declare const PUBLIC: { readonly [K in keyof ProvidesByKind]: readonly (keyof ProvidesByKind[K])[] };
|
|
781
|
+
export declare const PUBLIC: { readonly [K in keyof ProvidesByKind]: readonly (keyof ProvidesByKind[K])[]; };
|
|
827
782
|
//#endregion
|
|
828
783
|
//#region src/derive.d.ts
|
|
829
784
|
/** Whether a declaration names a parent. */
|
|
830
|
-
declare function isDerived(declaration: Declaration): declaration is DerivedDeclaration & {
|
|
785
|
+
export declare function isDerived(declaration: Declaration): declaration is DerivedDeclaration & {
|
|
831
786
|
of: ConstructId;
|
|
832
787
|
};
|
|
833
788
|
/**
|
|
@@ -837,7 +792,7 @@ declare function isDerived(declaration: Declaration): declaration is DerivedDecl
|
|
|
837
792
|
* make cycles unreachable — a reader is terminal, so no chain of `of` can
|
|
838
793
|
* return to where it started, and no walk is needed to prove it.
|
|
839
794
|
*/
|
|
840
|
-
declare function assertDerivations(manifest: ConstructManifest): void;
|
|
795
|
+
export declare function assertDerivations(manifest: ConstructManifest): void;
|
|
841
796
|
/**
|
|
842
797
|
* The order constructs must be provisioned in: every parent before its children.
|
|
843
798
|
*
|
|
@@ -850,7 +805,7 @@ declare function assertDerivations(manifest: ConstructManifest): void;
|
|
|
850
805
|
* Assumes {@link assertDerivations} has passed — a missing parent would
|
|
851
806
|
* otherwise be a silent omission here rather than an error.
|
|
852
807
|
*/
|
|
853
|
-
declare function provisionOrder(manifest: ConstructManifest): string[];
|
|
808
|
+
export declare function provisionOrder(manifest: ConstructManifest): string[];
|
|
854
809
|
/**
|
|
855
810
|
* Every edge a declaration carries, wherever the kind happens to keep them.
|
|
856
811
|
*
|
|
@@ -860,7 +815,7 @@ declare function provisionOrder(manifest: ConstructManifest): string[];
|
|
|
860
815
|
* nothing more). Flattening that difference here is what lets every consumer of
|
|
861
816
|
* the graph — reverse lookups, filtering, reference checks — ask one question.
|
|
862
817
|
*/
|
|
863
|
-
declare function dependenciesOf(declaration: Declaration): readonly Dependency[];
|
|
818
|
+
export declare function dependenciesOf(declaration: Declaration): readonly Dependency[];
|
|
864
819
|
/**
|
|
865
820
|
* The ids that depend on one construct — the graph read backwards.
|
|
866
821
|
*
|
|
@@ -874,7 +829,7 @@ declare function dependenciesOf(declaration: Declaration): readonly Dependency[]
|
|
|
874
829
|
* change whenever the manifest's key order did — and a value that churns is a
|
|
875
830
|
* container that redeploys for no reason.
|
|
876
831
|
*/
|
|
877
|
-
declare function dependentsOf(manifest: ConstructManifest, id: ConstructId): string[];
|
|
832
|
+
export declare function dependentsOf(manifest: ConstructManifest, id: ConstructId): string[];
|
|
878
833
|
/**
|
|
879
834
|
* How each site variant names a value it ships to the browser.
|
|
880
835
|
*
|
|
@@ -882,7 +837,7 @@ declare function dependentsOf(manifest: ConstructManifest, id: ConstructId): str
|
|
|
882
837
|
* `EXPO_PUBLIC_` all mean "inline this into the bundle" — so it is the one thing
|
|
883
838
|
* a variant changes, and it changes nothing else.
|
|
884
839
|
*/
|
|
885
|
-
declare const PUBLIC_PREFIX: Record<SiteDeclaration['variant'], string>;
|
|
840
|
+
export declare const PUBLIC_PREFIX: Record<SiteDeclaration['variant'], string>;
|
|
886
841
|
/**
|
|
887
842
|
* The keys a site's bundle needs, mapped to the key each value comes from —
|
|
888
843
|
* `{ VITE_API_URL: 'API_URL' }`.
|
|
@@ -901,8 +856,7 @@ declare const PUBLIC_PREFIX: Record<SiteDeclaration['variant'], string>;
|
|
|
901
856
|
* Shared by every target for the same reason `providedKeyFor` is: a site built
|
|
902
857
|
* locally and the same site built by a deploy must inline the same names.
|
|
903
858
|
*/
|
|
904
|
-
declare function publicEnvFor(declaration: SiteDeclaration, manifest: ConstructManifest): Record<string, string>;
|
|
905
|
-
//# sourceMappingURL=derive.d.ts.map
|
|
859
|
+
export declare function publicEnvFor(declaration: SiteDeclaration, manifest: ConstructManifest): Record<string, string>;
|
|
906
860
|
//#endregion
|
|
907
861
|
//#region src/errors.d.ts
|
|
908
862
|
/**
|
|
@@ -913,7 +867,7 @@ declare function publicEnvFor(declaration: SiteDeclaration, manifest: ConstructM
|
|
|
913
867
|
* is thrown, and carries user input into every log line that touches it.
|
|
914
868
|
*/
|
|
915
869
|
/** A construct id that cannot survive the names derived from it. */
|
|
916
|
-
declare class InvalidConstructId extends Error {
|
|
870
|
+
export declare class InvalidConstructId extends Error {
|
|
917
871
|
/** What was passed in. */
|
|
918
872
|
readonly input: string;
|
|
919
873
|
/** What canonicalising it produced, which is what failed the rule. */
|
|
@@ -921,7 +875,7 @@ declare class InvalidConstructId extends Error {
|
|
|
921
875
|
constructor(input: string, canonical: string);
|
|
922
876
|
}
|
|
923
877
|
/** A derived construct naming a parent the manifest does not contain. */
|
|
924
|
-
declare class UnknownParent extends Error {
|
|
878
|
+
export declare class UnknownParent extends Error {
|
|
925
879
|
/** The derived construct. */
|
|
926
880
|
readonly id: string;
|
|
927
881
|
/** The parent it named. */
|
|
@@ -934,7 +888,7 @@ declare class UnknownParent extends Error {
|
|
|
934
888
|
* A derived construct naming a parent that may not vend it — a reader of a
|
|
935
889
|
* reader, a schema of a schema.
|
|
936
890
|
*/
|
|
937
|
-
declare class IllegalDerivation extends Error {
|
|
891
|
+
export declare class IllegalDerivation extends Error {
|
|
938
892
|
readonly id: string;
|
|
939
893
|
readonly kind: string;
|
|
940
894
|
/** The kind of the parent it named. */
|
|
@@ -943,7 +897,6 @@ declare class IllegalDerivation extends Error {
|
|
|
943
897
|
readonly allowed: readonly string[];
|
|
944
898
|
constructor(id: string, kind: string, parentKind: string, allowed: readonly string[]);
|
|
945
899
|
}
|
|
946
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
947
900
|
//#endregion
|
|
948
901
|
//#region src/naming.d.ts
|
|
949
902
|
/**
|
|
@@ -956,14 +909,14 @@ declare class IllegalDerivation extends Error {
|
|
|
956
909
|
* @example environmentCase('sendEmail') // 'SEND_EMAIL'
|
|
957
910
|
* @example environmentCase('api2') // 'API2' (digit joins its word)
|
|
958
911
|
*/
|
|
959
|
-
declare function environmentCase(name: string): string;
|
|
912
|
+
export declare function environmentCase(name: string): string;
|
|
960
913
|
/**
|
|
961
914
|
* The env key a construct provides for one of its roles.
|
|
962
915
|
*
|
|
963
916
|
* @example provideKey('Uploads', 'url') // 'UPLOADS_URL'
|
|
964
917
|
* @example provideKey('Uploads', 'cdnUrl') // 'UPLOADS_CDN_URL'
|
|
965
918
|
*/
|
|
966
|
-
declare function provideKey(id: string, role: string): string;
|
|
919
|
+
export declare function provideKey(id: string, role: string): string;
|
|
967
920
|
/**
|
|
968
921
|
* A construct's canonical id — PascalCase.
|
|
969
922
|
*
|
|
@@ -977,7 +930,7 @@ declare function provideKey(id: string, role: string): string;
|
|
|
977
930
|
*
|
|
978
931
|
* @example canonicalId('user-uploads') // 'UserUploads'
|
|
979
932
|
*/
|
|
980
|
-
declare function canonicalId(input: string): string;
|
|
933
|
+
export declare function canonicalId(input: string): string;
|
|
981
934
|
/**
|
|
982
935
|
* The key a construct is reached under in the service record.
|
|
983
936
|
*
|
|
@@ -987,7 +940,7 @@ declare function canonicalId(input: string): string;
|
|
|
987
940
|
*
|
|
988
941
|
* @example serviceKey('UserUploads') // 'userUploads' → services.userUploads
|
|
989
942
|
*/
|
|
990
|
-
declare function serviceKey(id: string): string;
|
|
943
|
+
export declare function serviceKey(id: string): string;
|
|
991
944
|
/**
|
|
992
945
|
* The table a cache keeps its entries in, when nobody named one.
|
|
993
946
|
*
|
|
@@ -1005,7 +958,7 @@ declare function serviceKey(id: string): string;
|
|
|
1005
958
|
*
|
|
1006
959
|
* @example cacheTable('Sessions') // 'cache_sessions'
|
|
1007
960
|
*/
|
|
1008
|
-
declare function cacheTable(id: string): string;
|
|
961
|
+
export declare function cacheTable(id: string): string;
|
|
1009
962
|
/**
|
|
1010
963
|
* Kebab-cases an identifier, acronym- and digit-aware.
|
|
1011
964
|
*
|
|
@@ -1020,7 +973,7 @@ declare function cacheTable(id: string): string;
|
|
|
1020
973
|
* direction — `api2` keeps its digit — so the two spellings of "kebab this id"
|
|
1021
974
|
* in this file did not even agree with each other.
|
|
1022
975
|
*/
|
|
1023
|
-
declare function kebabCase(value: string): string;
|
|
976
|
+
export declare function kebabCase(value: string): string;
|
|
1024
977
|
/**
|
|
1025
978
|
* The physical name a target provisions a construct under — lowercase kebab,
|
|
1026
979
|
* scoped so two stages or apps sharing an account cannot collide.
|
|
@@ -1037,7 +990,7 @@ declare function kebabCase(value: string): string;
|
|
|
1037
990
|
* @example cloudName({ stage: 'prod', app: 'myapp' }, 'UserUploads')
|
|
1038
991
|
* // 'prod-myapp-user-uploads'
|
|
1039
992
|
*/
|
|
1040
|
-
declare function cloudName(scope: {
|
|
993
|
+
export declare function cloudName(scope: {
|
|
1041
994
|
stage: string;
|
|
1042
995
|
app: string;
|
|
1043
996
|
}, id: string): string;
|
|
@@ -1047,7 +1000,7 @@ declare function cloudName(scope: {
|
|
|
1047
1000
|
* The SST target's stacks add a segment of their own, so the prefix is not
|
|
1048
1001
|
* always two parts — which is the only reason this signature exists.
|
|
1049
1002
|
*/
|
|
1050
|
-
declare function scopedName(scope: readonly string[], id: string): string;
|
|
1003
|
+
export declare function scopedName(scope: readonly string[], id: string): string;
|
|
1051
1004
|
/**
|
|
1052
1005
|
* The domain a cookie must be scoped to so a surface and its callers share it.
|
|
1053
1006
|
*
|
|
@@ -1073,7 +1026,7 @@ declare function scopedName(scope: readonly string[], id: string): string;
|
|
|
1073
1026
|
* expiring dataset — so this requires at least two labels and otherwise trusts
|
|
1074
1027
|
* the addresses, and the value stays overridable for the case it gets wrong.
|
|
1075
1028
|
*/
|
|
1076
|
-
declare function cookieDomain(urls: readonly string[]): string | undefined;
|
|
1029
|
+
export declare function cookieDomain(urls: readonly string[]): string | undefined;
|
|
1077
1030
|
/**
|
|
1078
1031
|
* The env key a construct's provided role actually becomes.
|
|
1079
1032
|
*
|
|
@@ -1087,8 +1040,7 @@ declare function cookieDomain(urls: readonly string[]): string | undefined;
|
|
|
1087
1040
|
* to catch — and a check deriving the key differently from the thing it checks
|
|
1088
1041
|
* cannot catch anything.
|
|
1089
1042
|
*/
|
|
1090
|
-
declare function providedKeyFor(id: string, kind: DeclarationKind, role: string): string;
|
|
1091
|
-
//# sourceMappingURL=naming.d.ts.map
|
|
1043
|
+
export declare function providedKeyFor(id: string, kind: DeclarationKind, role: string): string;
|
|
1092
1044
|
//#endregion
|
|
1093
1045
|
//#region src/index.d.ts
|
|
1094
1046
|
/**
|
|
@@ -1096,11 +1048,11 @@ declare function providedKeyFor(id: string, kind: DeclarationKind, role: string)
|
|
|
1096
1048
|
* (e.g. by authorizer), an object keyed by partition name. Readonly-tolerant so
|
|
1097
1049
|
* the `as const` generated manifest assigns cleanly.
|
|
1098
1050
|
*/
|
|
1099
|
-
type ManifestField<T> = readonly T[] | Readonly<Record<string, readonly T[]>>;
|
|
1051
|
+
export type ManifestField<T> = readonly T[] | Readonly<Record<string, readonly T[]>>;
|
|
1100
1052
|
/** Flatten a manifest field (array or partitioned) into a plain array. */
|
|
1101
|
-
declare function flattenManifestField<T>(field: ManifestField<T> | undefined): T[];
|
|
1053
|
+
export declare function flattenManifestField<T>(field: ManifestField<T> | undefined): T[];
|
|
1102
1054
|
/** A single HTTP route. */
|
|
1103
|
-
interface RouteInfo {
|
|
1055
|
+
export interface RouteInfo {
|
|
1104
1056
|
/** Route path, e.g. `/users/{id}`. */
|
|
1105
1057
|
path: string;
|
|
1106
1058
|
/** HTTP method, e.g. `GET`. */
|
|
@@ -1124,7 +1076,7 @@ interface RouteInfo {
|
|
|
1124
1076
|
authorizer: string;
|
|
1125
1077
|
}
|
|
1126
1078
|
/** A standalone Lambda function. */
|
|
1127
|
-
interface FunctionInfo {
|
|
1079
|
+
export interface FunctionInfo {
|
|
1128
1080
|
name: string;
|
|
1129
1081
|
handler: string;
|
|
1130
1082
|
timeout?: number;
|
|
@@ -1141,7 +1093,7 @@ interface FunctionInfo {
|
|
|
1141
1093
|
dependencies?: readonly string[];
|
|
1142
1094
|
}
|
|
1143
1095
|
/** A scheduled (cron) function. */
|
|
1144
|
-
interface CronInfo {
|
|
1096
|
+
export interface CronInfo {
|
|
1145
1097
|
name: string;
|
|
1146
1098
|
handler: string;
|
|
1147
1099
|
/** Schedule expression, e.g. `rate(1 day)` or `cron(0 12 * * ? *)`. */
|
|
@@ -1160,7 +1112,7 @@ interface CronInfo {
|
|
|
1160
1112
|
dependencies?: readonly string[];
|
|
1161
1113
|
}
|
|
1162
1114
|
/** An event subscriber function (topic/queue resolved by `transport`). */
|
|
1163
|
-
interface SubscriberInfo {
|
|
1115
|
+
export interface SubscriberInfo {
|
|
1164
1116
|
name: string;
|
|
1165
1117
|
handler: string;
|
|
1166
1118
|
subscribedEvents: readonly string[];
|
|
@@ -1186,7 +1138,7 @@ interface SubscriberInfo {
|
|
|
1186
1138
|
* contract; producers publish via the derived publisher and {@link SubscriberInfo}s
|
|
1187
1139
|
* bind to it. Infra provisions an SNS topic.
|
|
1188
1140
|
*/
|
|
1189
|
-
interface TopicInfo {
|
|
1141
|
+
export interface TopicInfo {
|
|
1190
1142
|
name: string;
|
|
1191
1143
|
/** The event type names this topic carries. */
|
|
1192
1144
|
events: readonly string[];
|
|
@@ -1194,7 +1146,7 @@ interface TopicInfo {
|
|
|
1194
1146
|
fifo?: boolean;
|
|
1195
1147
|
}
|
|
1196
1148
|
/** A queue worker — a queue and its single consumer. */
|
|
1197
|
-
interface QueueInfo {
|
|
1149
|
+
export interface QueueInfo {
|
|
1198
1150
|
name: string;
|
|
1199
1151
|
handler: string;
|
|
1200
1152
|
/** SQS event-source batch size. */
|
|
@@ -1216,7 +1168,7 @@ interface QueueInfo {
|
|
|
1216
1168
|
* generated `manifest/<provider>.ts`. Each field is a {@link ManifestField}
|
|
1217
1169
|
* (flat or partitioned).
|
|
1218
1170
|
*/
|
|
1219
|
-
interface Manifest {
|
|
1171
|
+
export interface Manifest {
|
|
1220
1172
|
routes: ManifestField<RouteInfo>;
|
|
1221
1173
|
functions?: ManifestField<FunctionInfo>;
|
|
1222
1174
|
crons?: ManifestField<CronInfo>;
|
|
@@ -1224,8 +1176,6 @@ interface Manifest {
|
|
|
1224
1176
|
queues?: ManifestField<QueueInfo>;
|
|
1225
1177
|
topics?: ManifestField<TopicInfo>;
|
|
1226
1178
|
}
|
|
1227
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1228
|
-
|
|
1229
1179
|
//#endregion
|
|
1230
|
-
export { AllProvidedKeys, AppSpec, CacheDeclaration, ConstructId, ConstructManifest, ConstructName, CredentialDeclaration, CronDeclaration,
|
|
1180
|
+
export type { AllProvidedKeys, AppSpec, CacheDeclaration, ConstructId, ConstructManifest, ConstructName, CredentialDeclaration, CronDeclaration, DatabaseDeclaration, DatabaseReaderDeclaration, DatabaseSchemaDeclaration, Declaration, DeclarationKind, DeclarationOf, Dependency, DerivedDeclaration, DerivedKind, EmailDeclaration, FileServerDeclaration, Fn, FunctionDeclaration, Glob, IdsOf, IdsOfKind, Node, ObjectsDeclaration, OidcDeclaration, PostgresVersion, ProvidedKeys, Provides, ProvidesByKind, QueueDeclaration, RestApiDeclaration, RestApiEndpoint, SecretDeclaration, SiteDeclaration, TopicDeclaration, WorkerDeclaration };
|
|
1231
1181
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/declaration.ts","../src/derive.ts","../src/errors.ts","../src/naming.ts","../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/declaration.ts","../src/derive.ts","../src/errors.ts","../src/naming.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAkBY;KAEP;;;;;;;;;;;;;;KAeO,cAAc,oBAAoB,oDAE3C,aAAa,kEAEZ;;UAGa;EAChB,IAAI;;;;;;EAMJ;;;;;;EAMA;;;;;;;UAQgB,WAAW,gBAAgB,cAAc;;;;;;EAMzD,QAAQ;EACR,MAAM;;;UAIU,WAAW;EAC3B;EACA,uBAAuB;;;UAQP,2BAA2B;EAC3C;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BgB,8BAA8B;EAC9C;;EAEA,IAAI;;;;;;;EAOJ;;;;;;;;;;;;;;;;;UAkBgB,yBAAyB;EACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCW;;;;;;;;;;qBAWC,0BAA0B;UAEtB,4BAA4B;EAC5C;EACA;;;;;;;;;;EAUA,UAAU;;;;;;EAMV;;;;;;EAMA;;;;;;;;;UAUgB,kCAAkC;EAClD;EACA,IAAI;;;;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