@geekmidas/constructs 10.0.0-alpha.18 → 10.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +3 -3
  2. package/dist/{Construct-DfbwIntp.d.cts → Construct-DTqYvkPG.d.cts} +2 -2
  3. package/dist/{Construct-l5aOn_jv.d.mts.map → Construct-DTqYvkPG.d.cts.map} +1 -1
  4. package/dist/{Construct-BeYVu_QF.mjs → Construct-Detz65RA.mjs} +2 -2
  5. package/dist/Construct-Detz65RA.mjs.map +1 -0
  6. package/dist/{Construct-l5aOn_jv.d.mts → Construct-pVadmURD.d.mts} +2 -2
  7. package/dist/{Construct-DfbwIntp.d.cts.map → Construct-pVadmURD.d.mts.map} +1 -1
  8. package/dist/{Construct-DqdlARxq.cjs → Construct-yG9Sw-5p.cjs} +2 -2
  9. package/dist/Construct-yG9Sw-5p.cjs.map +1 -0
  10. package/dist/{Cron-l4Wlz6G9.d.mts → Cron-DFFsKfMQ.d.mts} +2 -2
  11. package/dist/{Cron-l4Wlz6G9.d.mts.map → Cron-DFFsKfMQ.d.mts.map} +1 -1
  12. package/dist/{Cron-zsoSAwZo.d.cts → Cron-szLBpMSi.d.cts} +2 -2
  13. package/dist/{Cron-zsoSAwZo.d.cts.map → Cron-szLBpMSi.d.cts.map} +1 -1
  14. package/dist/{CronBuilder-UoNgFe8S.d.mts → CronBuilder-Czxh8nnD.d.mts} +3 -3
  15. package/dist/{CronBuilder-CyT71Nzg.d.cts.map → CronBuilder-Czxh8nnD.d.mts.map} +1 -1
  16. package/dist/{CronBuilder-CyT71Nzg.d.cts → CronBuilder-kqU9icLS.d.cts} +3 -3
  17. package/dist/{CronBuilder-UoNgFe8S.d.mts.map → CronBuilder-kqU9icLS.d.cts.map} +1 -1
  18. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-vkjuo1UP.mjs} +3 -3
  19. package/dist/{CronBuilder-D_0HNBTr.mjs.map → CronBuilder-vkjuo1UP.mjs.map} +1 -1
  20. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-zdTdaT-e.cjs} +3 -3
  21. package/dist/{CronBuilder-BdnI6lxF.cjs.map → CronBuilder-zdTdaT-e.cjs.map} +1 -1
  22. package/dist/{Endpoint-ONsly_dq.mjs → Endpoint-BIpXUxNf.mjs} +3 -3
  23. package/dist/{Endpoint-ONsly_dq.mjs.map → Endpoint-BIpXUxNf.mjs.map} +1 -1
  24. package/dist/{Endpoint-BpZHtJ2W.cjs → Endpoint-DDRSyB7y.cjs} +3 -3
  25. package/dist/{Endpoint-BpZHtJ2W.cjs.map → Endpoint-DDRSyB7y.cjs.map} +1 -1
  26. package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-DVBog_2-.d.mts} +2 -2
  27. package/dist/{Endpoint-DBflWAe4.d.cts.map → Endpoint-DVBog_2-.d.mts.map} +1 -1
  28. package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-DlGPQpsH.d.cts} +2 -2
  29. package/dist/{Endpoint-oS-Fe3d_.d.mts.map → Endpoint-DlGPQpsH.d.cts.map} +1 -1
  30. package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-BG6DLRJH.d.cts} +6 -57
  31. package/dist/EndpointFactory-BG6DLRJH.d.cts.map +1 -0
  32. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-BTj1GjZd.cjs} +4 -4
  33. package/dist/{EndpointFactory-CLvWuHyt.cjs.map → EndpointFactory-BTj1GjZd.cjs.map} +1 -1
  34. package/dist/{index-Cc4kKPag.d.mts → EndpointFactory-CrZXVjna.d.mts} +6 -57
  35. package/dist/EndpointFactory-CrZXVjna.d.mts.map +1 -0
  36. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-o_15B_ka.mjs} +4 -4
  37. package/dist/{EndpointFactory-Bm3aKRdV.mjs.map → EndpointFactory-o_15B_ka.mjs.map} +1 -1
  38. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-Bid8spbq.mjs} +2 -2
  39. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs.map → HonoEndpointAdaptor-Bid8spbq.mjs.map} +1 -1
  40. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-K97N70mh.cjs} +2 -2
  41. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs.map → HonoEndpointAdaptor-K97N70mh.cjs.map} +1 -1
  42. package/dist/{Queue-DYPB2KWL.d.cts → Queue-Bhzi2WQC.d.cts} +2 -2
  43. package/dist/{Queue-D9X6OoON.d.mts.map → Queue-Bhzi2WQC.d.cts.map} +1 -1
  44. package/dist/{Queue-D9X6OoON.d.mts → Queue-BoUA-e83.d.mts} +2 -2
  45. package/dist/{Queue-DYPB2KWL.d.cts.map → Queue-BoUA-e83.d.mts.map} +1 -1
  46. package/dist/{Subscriber-C4heaAyO.d.mts → Subscriber-CIO3pwji.d.mts} +2 -2
  47. package/dist/{Subscriber-C4heaAyO.d.mts.map → Subscriber-CIO3pwji.d.mts.map} +1 -1
  48. package/dist/{Subscriber-CotDUELC.d.cts → Subscriber-DQCaiOXF.d.cts} +2 -2
  49. package/dist/{Subscriber-CotDUELC.d.cts.map → Subscriber-DQCaiOXF.d.cts.map} +1 -1
  50. package/dist/{SubscriberBuilder-h7B_cHMr.mjs → SubscriberBuilder-B4YRTBng.mjs} +2 -2
  51. package/dist/{SubscriberBuilder-h7B_cHMr.mjs.map → SubscriberBuilder-B4YRTBng.mjs.map} +1 -1
  52. package/dist/{SubscriberBuilder-C0ZEtGDI.cjs → SubscriberBuilder-C2bCOuPT.cjs} +2 -2
  53. package/dist/{SubscriberBuilder-C0ZEtGDI.cjs.map → SubscriberBuilder-C2bCOuPT.cjs.map} +1 -1
  54. package/dist/{SubscriberBuilder-tyH5yTk5.d.mts → SubscriberBuilder-COW4rHnb.d.mts} +3 -3
  55. package/dist/{SubscriberBuilder-BEv0eoHy.d.cts.map → SubscriberBuilder-COW4rHnb.d.mts.map} +1 -1
  56. package/dist/{SubscriberBuilder-BEv0eoHy.d.cts → SubscriberBuilder-DQ7EWdGO.d.cts} +3 -3
  57. package/dist/{SubscriberBuilder-tyH5yTk5.d.mts.map → SubscriberBuilder-DQ7EWdGO.d.cts.map} +1 -1
  58. package/dist/{Topic-DEVGo0Dm.d.cts → Topic-D6blllEn.d.cts} +2 -2
  59. package/dist/{Topic-DEVGo0Dm.d.cts.map → Topic-D6blllEn.d.cts.map} +1 -1
  60. package/dist/{Topic-zk_6Gthr.d.mts → Topic-DVvheJ_-.d.mts} +2 -2
  61. package/dist/{Topic-zk_6Gthr.d.mts.map → Topic-DVvheJ_-.d.mts.map} +1 -1
  62. package/dist/adaptors/aws.cjs +2 -2
  63. package/dist/adaptors/aws.d.cts +5 -5
  64. package/dist/adaptors/aws.d.mts +5 -5
  65. package/dist/adaptors/aws.mjs +3 -3
  66. package/dist/adaptors/hono.cjs +1 -1
  67. package/dist/adaptors/hono.d.cts +1 -1
  68. package/dist/adaptors/hono.d.mts +1 -1
  69. package/dist/adaptors/hono.mjs +1 -1
  70. package/dist/adaptors/testing.cjs +3 -3
  71. package/dist/adaptors/testing.d.cts +4 -4
  72. package/dist/adaptors/testing.d.mts +4 -4
  73. package/dist/adaptors/testing.mjs +3 -3
  74. package/dist/crons/index.cjs +1 -1
  75. package/dist/crons/index.d.cts +2 -2
  76. package/dist/crons/index.d.mts +2 -2
  77. package/dist/crons/index.mjs +1 -1
  78. package/dist/endpoints/index.cjs +2 -2
  79. package/dist/endpoints/index.d.cts +60 -3
  80. package/dist/endpoints/index.d.cts.map +1 -0
  81. package/dist/endpoints/index.d.mts +60 -3
  82. package/dist/endpoints/index.d.mts.map +1 -0
  83. package/dist/endpoints/index.mjs +2 -2
  84. package/dist/functions/index.cjs +1 -1
  85. package/dist/functions/index.d.cts +1 -1
  86. package/dist/functions/index.d.mts +1 -1
  87. package/dist/functions/index.mjs +1 -1
  88. package/dist/{functions-B6qCvfmy.cjs → functions-VnOTEp74.cjs} +2 -2
  89. package/dist/{functions-B6qCvfmy.cjs.map → functions-VnOTEp74.cjs.map} +1 -1
  90. package/dist/{functions-C53GW2eQ.mjs → functions-faoJOUmr.mjs} +2 -2
  91. package/dist/{functions-C53GW2eQ.mjs.map → functions-faoJOUmr.mjs.map} +1 -1
  92. package/dist/{index-D_frT6MP.d.cts → index-D9gxXK1m.d.cts} +2 -2
  93. package/dist/{index-D_frT6MP.d.cts.map → index-D9gxXK1m.d.cts.map} +1 -1
  94. package/dist/{index-DcyIYbDS.d.mts → index-Df4DrCZd.d.mts} +2 -2
  95. package/dist/{index-DcyIYbDS.d.mts.map → index-Df4DrCZd.d.mts.map} +1 -1
  96. package/dist/{index-B2urf3YI.d.cts → index-fnpjXiA-.d.mts} +2 -2
  97. package/dist/{index-B2urf3YI.d.cts.map → index-fnpjXiA-.d.mts.map} +1 -1
  98. package/dist/{index-DMCDvnsM.d.mts → index-tE_119SX.d.cts} +2 -2
  99. package/dist/{index-DMCDvnsM.d.mts.map → index-tE_119SX.d.cts.map} +1 -1
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.d.cts +1 -1
  102. package/dist/index.d.mts +1 -1
  103. package/dist/index.mjs +1 -1
  104. package/dist/queue/index.cjs +1 -1
  105. package/dist/queue/index.d.cts +1 -1
  106. package/dist/queue/index.d.mts +1 -1
  107. package/dist/queue/index.mjs +1 -1
  108. package/dist/rest-api.cjs +56 -34
  109. package/dist/rest-api.cjs.map +1 -1
  110. package/dist/rest-api.d.cts +36 -23
  111. package/dist/rest-api.d.cts.map +1 -1
  112. package/dist/rest-api.d.mts +36 -23
  113. package/dist/rest-api.d.mts.map +1 -1
  114. package/dist/rest-api.mjs +56 -34
  115. package/dist/rest-api.mjs.map +1 -1
  116. package/dist/subscribers/index.cjs +1 -1
  117. package/dist/subscribers/index.d.cts +2 -2
  118. package/dist/subscribers/index.d.mts +2 -2
  119. package/dist/subscribers/index.mjs +1 -1
  120. package/dist/topic/index.cjs +1 -1
  121. package/dist/topic/index.d.cts +2 -2
  122. package/dist/topic/index.d.mts +2 -2
  123. package/dist/topic/index.mjs +1 -1
  124. package/dist/worker.cjs +3 -3
  125. package/dist/worker.d.cts +6 -6
  126. package/dist/worker.d.mts +6 -6
  127. package/dist/worker.mjs +3 -3
  128. package/package.json +30 -30
  129. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  130. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  131. package/dist/index-C1ZwNOOk.d.cts.map +0 -1
  132. package/dist/index-Cc4kKPag.d.mts.map +0 -1
package/dist/rest-api.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { edgeTo } from "./construct-interface.mjs";
2
- import { o as getSecurityScheme, t as EndpointFactory } from "./EndpointFactory-Bm3aKRdV.mjs";
2
+ import { o as getSecurityScheme, t as EndpointFactory } from "./EndpointFactory-o_15B_ka.mjs";
3
3
  import { n as envParserFor } from "./surfaceEnv-wMT5QzgZ.mjs";
4
4
  import { canonicalId, provideKey } from "@geekmidas/manifest";
5
5
  import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
@@ -11,8 +11,9 @@ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
11
11
  * into a handler. Putting one on the surface hands it to every route the
12
12
  * surface serves — a health check gets the database because a report needed it
13
13
  * — which is the thing least privilege forbids and the reason `.calls()` is not
14
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
15
- * from `api.endpoints` for a group of endpoints that genuinely share them.
14
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
15
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
16
+ * branch is a new factory; the surface config stays free of grants.
16
17
  *
17
18
  * `auth` is not here either: `.auth(construct)` already declares it, and a
18
19
  * second way to say the same thing is the duplication this whole model removes.
@@ -66,7 +67,7 @@ var RestApi = class RestApi {
66
67
  id: canonical,
67
68
  envParser: config.envParser
68
69
  } : void 0);
69
- this.endpoints = new EndpointFactory({
70
+ this.#endpoints = new EndpointFactory({
70
71
  defaultLogger: this.logger,
71
72
  ...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) => {
72
73
  const securityScheme = getSecurityScheme(name);
@@ -81,44 +82,65 @@ var RestApi = class RestApi {
81
82
  envParser: this.envParser
82
83
  }
83
84
  });
85
+ const endpoints = this.#endpoints;
86
+ this.get = endpoints.get.bind(endpoints);
87
+ this.post = endpoints.post.bind(endpoints);
88
+ this.put = endpoints.put.bind(endpoints);
89
+ this.patch = endpoints.patch.bind(endpoints);
90
+ this.delete = endpoints.delete.bind(endpoints);
91
+ this.options = endpoints.options.bind(endpoints);
92
+ this.database = endpoints.database.bind(endpoints);
93
+ this.session = endpoints.session.bind(endpoints);
94
+ this.auditor = endpoints.auditor.bind(endpoints);
95
+ this.actor = endpoints.actor.bind(endpoints);
96
+ this.publisher = endpoints.publisher.bind(endpoints);
97
+ this.authorizer = endpoints.authorizer.bind(endpoints);
98
+ this.authorize = endpoints.authorize.bind(endpoints);
99
+ this.rls = endpoints.rls.bind(endpoints);
100
+ this.route = endpoints.route.bind(endpoints);
84
101
  }
85
102
  /**
86
- * This surface's endpoint factory.
103
+ * This surface's endpoint factory, which every method below starts from.
87
104
  *
88
- * `api.get('/users')` is the short form and covers most routes. Reach for
89
- * this one when a *group* of endpoints shares something a single route would
90
- * otherwise repeat — a database, an auditor, a publisher:
105
+ * Private: a surface *is* where endpoints are built, so there is no second
106
+ * object to reach through first. `api.database(db)` said the same
107
+ * thing as `api.database(db)` with one more word to learn.
108
+ */
109
+ #endpoints;
110
+ /** `api.get('/users')` — one route on this surface. */
111
+ get;
112
+ post;
113
+ put;
114
+ patch;
115
+ delete;
116
+ options;
117
+ /**
118
+ * A branch for a *group* of endpoints that shares what a single route would
119
+ * otherwise repeat — a database, an auditor, a publisher, a session:
91
120
  *
92
121
  * ```ts
93
- * const audited = api.endpoints.database(db).auditor(AuditStore);
94
- * export const createUser = audited.post('/users').handle(...);
122
+ * export const router = api.database(database);
123
+ * export const createUser = router.post('/users').handle(({ db }) => …);
95
124
  * ```
96
125
  *
97
- * A factory branched from here keeps the surface, so its endpoints still
98
- * know which API serves them. That is deliberately narrower than putting the
99
- * same thing in the surface's own config: a group opts in, where a surface
100
- * would grant it to every route it serves.
126
+ * Each returns a new factory and leaves the surface as it was. That is the
127
+ * whole difference from putting the same thing in the surface's config: a
128
+ * group opts in, where the surface would grant it to every route it serves —
129
+ * a health check handed the database because a profile endpoint needed it.
130
+ *
131
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
132
+ * surface it would read as the API depending on something, which is what
133
+ * `.calls()` and `.auth()` say instead.
101
134
  */
102
- endpoints;
103
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
104
- get(path) {
105
- return this.endpoints.get(path);
106
- }
107
- post(path) {
108
- return this.endpoints.post(path);
109
- }
110
- put(path) {
111
- return this.endpoints.put(path);
112
- }
113
- patch(path) {
114
- return this.endpoints.patch(path);
115
- }
116
- delete(path) {
117
- return this.endpoints.delete(path);
118
- }
119
- options(path) {
120
- return this.endpoints.options(path);
121
- }
135
+ database;
136
+ session;
137
+ auditor;
138
+ actor;
139
+ publisher;
140
+ authorizer;
141
+ authorize;
142
+ rls;
143
+ route;
122
144
  /**
123
145
  * What authenticates this surface.
124
146
  *
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.mjs","names":[],"sources":["../src/rest-api.ts"],"sourcesContent":["/**\n * `RestApi` — the application's own HTTP surface, declared.\n *\n * Everything an app serves already existed; what did not exist was a *node* for\n * it. Without one, three things that are properties of the graph had to be\n * written down somewhere else: which origins the API accepts, which origins the\n * auth server trusts, and which URL a frontend is built against. All three were\n * being derived by walking the workspace config for ports — a second mechanism,\n * running beside the graph and answering the same question worse, since it can\n * only ever describe what this repo happens to run.\n *\n * With the surface declared, all three become one edge read backwards: a\n * consumer depends on the API, and *that* is the CORS entry, the trusted origin,\n * and the build-time URL. Nothing enumerates its own callers.\n *\n * ```ts\n * export const api = new RestApi('Api', {\n * authorizers: ['session'],\n * defaultAuthorizer: 'session',\n * });\n * ```\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport type { Telescope } from '@geekmidas/telescope';\nimport { type Declarable, edgeTo } from './construct-interface';\nimport {\n\ttype BuiltInSecuritySchemeId,\n\tgetSecurityScheme,\n} from './endpoints/Authorizer';\nimport { EndpointFactory } from './endpoints/EndpointFactory';\nimport { envParserFor } from './endpoints/surfaceEnv';\n\nexport interface RestApiConfig<\n\t// `readonly []` rather than `readonly string[]`: a surface that declares no\n\t// authorizers of its own should narrow `defaultAuthorizer` to the built-ins\n\t// and `'none'`, not widen it back to any string.\n\tTAuthorizers extends readonly string[] = readonly [],\n> {\n\t/**\n\t * The app that serves this surface, relative to the workspace root —\n\t * `'apps/api'`, or `'.'` in a single-app project.\n\t *\n\t * Required. It was inferred from the id (`apps/<kebab-id>`, or the root\n\t * when no such directory existed), which meant a surface's home was\n\t * whatever happened to be on disk. It is where the app's `package.json`\n\t * and base `tsconfig.json` are, and which build serves this surface. It\n\t * does not change discovery: constructs still load from the workspace's\n\t * `constructs` glob.\n\t */\n\tpath: string;\n\t/**\n\t * CORS tunables. The *origins* are never here — they are read off the\n\t * constructs that declared an edge to this surface, which is the whole point\n\t * of declaring one. These are the parts a graph cannot answer.\n\t */\n\tcors?: {\n\t\tmaxAge?: number;\n\t\tcredentials?: boolean;\n\t\tallowHeaders?: readonly string[];\n\t\texposeHeaders?: readonly string[];\n\t};\n\t/**\n\t * The authorizer names this surface exposes. Names only — what verifies a\n\t * request legitimately differs between local and deployed, so the mechanism\n\t * belongs to the target and never to portable code.\n\t */\n\tauthorizers?: TAuthorizers;\n\t/**\n\t * The authorizer applied to an endpoint that names none.\n\t *\n\t * Required, and `'none'` is a valid answer that has to be typed out. The\n\t * alternative is an API that ships open because a field was left off, which\n\t * is the one default worth refusing to have.\n\t *\n\t * It was called `default`, which said what it was to the type and nothing\n\t * to the reader: next to `authorizers: ['iam']`, a bare `default: 'none'`\n\t * could be defaulting the runtime or the target. The manifest has always\n\t * called it `defaultAuthorizer` and the factory `defaultAuthorizerName`;\n\t * this is the same fact under the same name.\n\t *\n\t * Typed from `authorizers`, so it can only name one this surface exposes —\n\t * plus a built-in scheme, and `'none'`. It was a bare `string`, which let\n\t * `defaultAuthorizer: 'jwtt'` compile and every endpoint on the surface\n\t * default to an authorizer that does not exist.\n\t */\n\tdefaultAuthorizer: TAuthorizers[number] | BuiltInSecuritySchemeId | 'none';\n\t/**\n\t * The logger every endpoint on this surface runs with.\n\t *\n\t * The actual logger, not a path to one. It used to be named in config as\n\t * `logger: './config/logger'`, because the build wrote an import into each\n\t * generated handler and a generator can print a specifier but not an object.\n\t * Endpoints built from the surface carry it, so there is nothing to print\n\t * and nothing to keep in step with a moved file.\n\t */\n\tlogger?: Logger;\n\t/**\n\t * The environment parser every endpoint on this surface runs with.\n\t *\n\t * Same reason as `logger`, and the same field it replaces —\n\t * `envParser: './config/env#envParser'`, a module path with an export name\n\t * appended, parsed by us, checked by nothing.\n\t */\n\tenvParser?: EnvironmentParser<{}>;\n\t/**\n\t * The Telescope instance this surface's entry mounts.\n\t *\n\t * The actual instance, for the reason `logger` is: it used to be named as\n\t * `telescope: './config/telescope#telescope'`, a module path the build\n\t * printed an import for. The entry already imports the surface.\n\t */\n\ttelescope?: Telescope;\n}\n\n/**\n * What is *not* here, and why.\n *\n * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability\n * into a handler. Putting one on the surface hands it to every route the\n * surface serves — a health check gets the database because a report needed it\n * — which is the thing least privilege forbids and the reason `.calls()` is not\n * spelled `dependsOn`. They belong to the endpoint, or to a factory branched\n * from `api.endpoints` for a group of endpoints that genuinely share them.\n *\n * `auth` is not here either: `.auth(construct)` already declares it, and a\n * second way to say the same thing is the duplication this whole model removes.\n *\n * What is left is what the *process* is rather than what a route may reach.\n */\n\nexport class RestApi<\n\tTName extends string = string,\n\tconst TAuthorizers extends readonly string[] = readonly [],\n> implements Declarable<TName>\n{\n\treadonly id: TName;\n\n\t/**\n\t * Declared once and read by both `declare()` and anything that consumes this\n\t * surface, so what the target publishes and what a consumer reads cannot\n\t * drift.\n\t */\n\treadonly keys: {\n\t\turl: string;\n\t\ttrustedOrigins: string;\n\t\tcookieDomain: string;\n\t};\n\n\t/**\n\t * The logger every endpoint on this surface runs with.\n\t *\n\t * Always defined — the surface's own if it was given one, the console\n\t * logger otherwise — so nothing downstream has to decide what to do about a\n\t * missing one. The generated entry reads it from here.\n\t */\n\treadonly logger: Logger;\n\n\t/**\n\t * The environment parser every endpoint on this surface runs with.\n\t *\n\t * Always defined, and normally the default: `process.env` merged with the\n\t * credentials `gkm dev`/`gkm exec` injected. That is what every\n\t * application's own `config/env.ts` was — boilerplate identical in every\n\t * project, and mandatory, which is a poor combination.\n\t */\n\treadonly envParser: EnvironmentParser<{}>;\n\n\t/** The Telescope instance, when this surface was given one. */\n\treadonly telescope?: Telescope;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: RestApiConfig<TAuthorizers>,\n\t\t/** Internal: how `.calls()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t\t/** Internal: how `.auth()` carries the authenticator into its copy. */\n\t\tprivate readonly authenticator?: string,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\ttrustedOrigins: provideKey(canonical, 'trustedOrigins'),\n\t\t\tcookieDomain: provideKey(canonical, 'cookieDomain'),\n\t\t};\n\n\t\tthis.logger = config.logger ?? DEFAULT_LOGGER;\n\t\tthis.telescope = config.telescope;\n\t\tthis.envParser = envParserFor(\n\t\t\tconfig.envParser\n\t\t\t\t? { id: canonical, envParser: config.envParser }\n\t\t\t\t: undefined,\n\t\t);\n\n\t\tthis.endpoints = new EndpointFactory({\n\t\t\tdefaultLogger: this.logger,\n\t\t\t...(config.authorizers\n\t\t\t\t? {\n\t\t\t\t\t\t// With the scheme a built-in name stands for, as the factory's own\n\t\t\t\t\t\t// `.authorizers()` resolves it. Bare names reached the OpenAPI\n\t\t\t\t\t\t// document with no scheme, so a guarded endpoint read as public.\n\t\t\t\t\t\tavailableAuthorizers: config.authorizers.map((name) => {\n\t\t\t\t\t\t\tconst securityScheme = getSecurityScheme(name);\n\t\t\t\t\t\t\treturn securityScheme ? { name, securityScheme } : { name };\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// `'none'` reaches the factory as no default at all, which is what\n\t\t\t// public means to an endpoint that names no authorizer.\n\t\t\t...(config.defaultAuthorizer && config.defaultAuthorizer !== 'none'\n\t\t\t\t? { defaultAuthorizerName: config.defaultAuthorizer }\n\t\t\t\t: {}),\n\t\t\tsurface: { id: this.id, envParser: this.envParser },\n\t\t});\n\t}\n\n\t/**\n\t * This surface's endpoint factory.\n\t *\n\t * `api.get('/users')` is the short form and covers most routes. Reach for\n\t * this one when a *group* of endpoints shares something a single route would\n\t * otherwise repeat — a database, an auditor, a publisher:\n\t *\n\t * ```ts\n\t * const audited = api.endpoints.database(db).auditor(AuditStore);\n\t * export const createUser = audited.post('/users').handle(...);\n\t * ```\n\t *\n\t * A factory branched from here keeps the surface, so its endpoints still\n\t * know which API serves them. That is deliberately narrower than putting the\n\t * same thing in the surface's own config: a group opts in, where a surface\n\t * would grant it to every route it serves.\n\t */\n\treadonly endpoints: EndpointFactory<[], '', Logger>;\n\n\t/** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */\n\tget<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.get(path);\n\t}\n\n\tpost<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.post(path);\n\t}\n\n\tput<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.put(path);\n\t}\n\n\tpatch<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.patch(path);\n\t}\n\n\tdelete<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.delete(path);\n\t}\n\n\toptions<TPath extends string>(path: TPath) {\n\t\treturn this.endpoints.options(path);\n\t}\n\n\t/**\n\t * What authenticates this surface.\n\t *\n\t * An edge like `.calls()` — the auth server learns this origin, and the two\n\t * share a cookie domain — but a named one, because *who authenticates me* is\n\t * a different fact from *who I happen to call*, and only one of them decides\n\t * what a request is allowed to be. A surface with two of the first is a\n\t * mistake; two of the second is Tuesday.\n\t *\n\t * It records the id, not a client. Every endpoint consumes the same thing —\n\t * `verify(request) → Session | null` — and that is what every provider\n\t * shares, whether the server is mounted in this process, deployed beside it,\n\t * or an OIDC issuer somebody else runs.\n\t */\n\tauth(construct: Declarable): RestApi<TName, TAuthorizers> {\n\t\treturn new RestApi<TName, TAuthorizers>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, edgeTo(construct)],\n\t\t\tconstruct.id,\n\t\t);\n\t}\n\n\t/**\n\t * Other surfaces this one calls.\n\t *\n\t * **Not `.dependsOn()`, and the difference matters.** An endpoint's\n\t * `.dependsOn()` injects a client into that handler and grants it exactly\n\t * what it named. This grants nothing and injects nothing: it records that\n\t * this API calls another surface, which is what puts this API's origin on\n\t * that surface's trusted-origin list.\n\t *\n\t * Spelling it `dependsOn` would invite the thing least privilege forbids —\n\t * every route on the surface receiving whatever the surface named.\n\t *\n\t * Immutable, like every other builder here.\n\t */\n\tcalls(constructs: readonly Declarable[]): RestApi<TName, TAuthorizers> {\n\t\treturn new RestApi<TName, TAuthorizers>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, ...constructs.map(edgeTo)],\n\t\t\tthis.authenticator,\n\t\t);\n\t}\n\n\t/**\n\t * One surface node, with its endpoints left to the build.\n\t *\n\t * The three provided keys are one fact about this surface and two about its\n\t * callers. Declaring the caller-derived pair here rather than having the\n\t * target invent them is what makes the contract checkable: a target that\n\t * resolves no origins is caught against this list instead of being noticed\n\t * when a browser is refused in production.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'rest-api',\n\t\t\t\tid: this.id,\n\t\t\t\tpath: this.config.path,\n\t\t\t\t...(this.config.telescope ? { telescope: true } : {}),\n\t\t\t\t...(this.config.cors ? { cors: this.config.cors } : {}),\n\t\t\t\t...(this.authenticator ? { auth: this.authenticator } : {}),\n\t\t\t\t// Filled by the build, which already generates one handler per\n\t\t\t\t// endpoint and knows the path it wrote it to. A surface that\n\t\t\t\t// enumerates its own routes statically — an auth server's single\n\t\t\t\t// wildcard — puts them here instead.\n\t\t\t\tendpoints: [],\n\t\t\t\t...(this.dependencies.length ? { calls: this.dependencies } : {}),\n\t\t\t\t...(this.config.authorizers?.length\n\t\t\t\t\t? { authorizers: this.config.authorizers }\n\t\t\t\t\t: {}),\n\t\t\t\tdefaultAuthorizer: this.config.defaultAuthorizer,\n\t\t\t\tprovides: [\n\t\t\t\t\tthis.keys.url,\n\t\t\t\t\tthis.keys.trustedOrigins,\n\t\t\t\t\tthis.keys.cookieDomain,\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4IA,IAAa,UAAb,MAAa,QAIb;CAsCmB;CAEA;CAEA;CAzClB;;;;;;CAOA;;;;;;;;CAaA;;;;;;;;;CAUA;;CAGA;CAEA,YACC,IACA,QAEA,eAAuD,CAAC,GAExD,eACC;EALgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAEA,KAAA,gBAAA;EAEjB,MAAM,YAAY,YAAY,EAAY;EAE1C,KAAK,KAAK;EAEV,KAAK,OAAO;GACX,KAAK,WAAW,WAAW,KAAK;GAChC,gBAAgB,WAAW,WAAW,gBAAgB;G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AG,WAAW,IAAI,MAAM,CAAC,GAChD,KAAK,aACN;CACD;;;;;;;;;;CAWA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,MAAM,KAAK,OAAO;GAClB,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,IAAI,CAAC;GACnD,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;GACrD,GAAI,KAAK,gBAAgB,EAAE,MAAM,KAAK,cAAc,IAAI,CAAC;GAKzD,WAAW,CAAC;GACZ,GAAI,KAAK,aAAa,SAAS,EAAE,OAAO,KAAK,aAAa,IAAI,CAAC;GAC/D,GAAI,KAAK,OAAO,aAAa,SAC1B,EAAE,aAAa,KAAK,OAAO,YAAY,IACvC,CAAC;GACJ,mBAAmB,KAAK,OAAO;GAC/B,UAAU;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;GACX;EACD,CACD;CACD;AACD"}
1
+ {"version":3,"file":"rest-api.mjs","names":[],"sources":["../src/rest-api.ts"],"sourcesContent":["/**\n * `RestApi` — the application's own HTTP surface, declared.\n *\n * Everything an app serves already existed; what did not exist was a *node* for\n * it. Without one, three things that are properties of the graph had to be\n * written down somewhere else: which origins the API accepts, which origins the\n * auth server trusts, and which URL a frontend is built against. All three were\n * being derived by walking the workspace config for ports — a second mechanism,\n * running beside the graph and answering the same question worse, since it can\n * only ever describe what this repo happens to run.\n *\n * With the surface declared, all three become one edge read backwards: a\n * consumer depends on the API, and *that* is the CORS entry, the trusted origin,\n * and the build-time URL. Nothing enumerates its own callers.\n *\n * ```ts\n * export const api = new RestApi('Api', {\n * authorizers: ['session'],\n * defaultAuthorizer: 'session',\n * });\n * ```\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport type { Telescope } from '@geekmidas/telescope';\nimport { type Declarable, edgeTo } from './construct-interface';\nimport {\n\ttype BuiltInSecuritySchemeId,\n\tgetSecurityScheme,\n} from './endpoints/Authorizer';\nimport { EndpointFactory } from './endpoints/EndpointFactory';\nimport { envParserFor } from './endpoints/surfaceEnv';\n\n/** The factory a surface builds its endpoints from. */\ntype Endpoints = EndpointFactory<[], '', Logger>;\n\nexport interface RestApiConfig<\n\t// `readonly []` rather than `readonly string[]`: a surface that declares no\n\t// authorizers of its own should narrow `defaultAuthorizer` to the built-ins\n\t// and `'none'`, not widen it back to any string.\n\tTAuthorizers extends readonly string[] = readonly [],\n> {\n\t/**\n\t * The app that serves this surface, relative to the workspace root —\n\t * `'apps/api'`, or `'.'` in a single-app project.\n\t *\n\t * Required. It was inferred from the id (`apps/<kebab-id>`, or the root\n\t * when no such directory existed), which meant a surface's home was\n\t * whatever happened to be on disk. It is where the app's `package.json`\n\t * and base `tsconfig.json` are, and which build serves this surface. It\n\t * does not change discovery: constructs still load from the workspace's\n\t * `constructs` glob.\n\t */\n\tpath: string;\n\t/**\n\t * CORS tunables. The *origins* are never here — they are read off the\n\t * constructs that declared an edge to this surface, which is the whole point\n\t * of declaring one. These are the parts a graph cannot answer.\n\t */\n\tcors?: {\n\t\tmaxAge?: number;\n\t\tcredentials?: boolean;\n\t\tallowHeaders?: readonly string[];\n\t\texposeHeaders?: readonly string[];\n\t};\n\t/**\n\t * The authorizer names this surface exposes. Names only — what verifies a\n\t * request legitimately differs between local and deployed, so the mechanism\n\t * belongs to the target and never to portable code.\n\t */\n\tauthorizers?: TAuthorizers;\n\t/**\n\t * The authorizer applied to an endpoint that names none.\n\t *\n\t * Required, and `'none'` is a valid answer that has to be typed out. The\n\t * alternative is an API that ships open because a field was left off, which\n\t * is the one default worth refusing to have.\n\t *\n\t * It was called `default`, which said what it was to the type and nothing\n\t * to the reader: next to `authorizers: ['iam']`, a bare `default: 'none'`\n\t * could be defaulting the runtime or the target. The manifest has always\n\t * called it `defaultAuthorizer` and the factory `defaultAuthorizerName`;\n\t * this is the same fact under the same name.\n\t *\n\t * Typed from `authorizers`, so it can only name one this surface exposes —\n\t * plus a built-in scheme, and `'none'`. It was a bare `string`, which let\n\t * `defaultAuthorizer: 'jwtt'` compile and every endpoint on the surface\n\t * default to an authorizer that does not exist.\n\t */\n\tdefaultAuthorizer: TAuthorizers[number] | BuiltInSecuritySchemeId | 'none';\n\t/**\n\t * The logger every endpoint on this surface runs with.\n\t *\n\t * The actual logger, not a path to one. It used to be named in config as\n\t * `logger: './config/logger'`, because the build wrote an import into each\n\t * generated handler and a generator can print a specifier but not an object.\n\t * Endpoints built from the surface carry it, so there is nothing to print\n\t * and nothing to keep in step with a moved file.\n\t */\n\tlogger?: Logger;\n\t/**\n\t * The environment parser every endpoint on this surface runs with.\n\t *\n\t * Same reason as `logger`, and the same field it replaces —\n\t * `envParser: './config/env#envParser'`, a module path with an export name\n\t * appended, parsed by us, checked by nothing.\n\t */\n\tenvParser?: EnvironmentParser<{}>;\n\t/**\n\t * The Telescope instance this surface's entry mounts.\n\t *\n\t * The actual instance, for the reason `logger` is: it used to be named as\n\t * `telescope: './config/telescope#telescope'`, a module path the build\n\t * printed an import for. The entry already imports the surface.\n\t */\n\ttelescope?: Telescope;\n}\n\n/**\n * What is *not* here, and why.\n *\n * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability\n * into a handler. Putting one on the surface hands it to every route the\n * surface serves — a health check gets the database because a report needed it\n * — which is the thing least privilege forbids and the reason `.calls()` is not\n * spelled `dependsOn`. They belong to the endpoint, or to a branch —\n * `api.database(db)` — for a group of endpoints that genuinely share them. A\n * branch is a new factory; the surface config stays free of grants.\n *\n * `auth` is not here either: `.auth(construct)` already declares it, and a\n * second way to say the same thing is the duplication this whole model removes.\n *\n * What is left is what the *process* is rather than what a route may reach.\n */\n\nexport class RestApi<\n\tTName extends string = string,\n\tconst TAuthorizers extends readonly string[] = readonly [],\n> implements Declarable<TName>\n{\n\treadonly id: TName;\n\n\t/**\n\t * Declared once and read by both `declare()` and anything that consumes this\n\t * surface, so what the target publishes and what a consumer reads cannot\n\t * drift.\n\t */\n\treadonly keys: {\n\t\turl: string;\n\t\ttrustedOrigins: string;\n\t\tcookieDomain: string;\n\t};\n\n\t/**\n\t * The logger every endpoint on this surface runs with.\n\t *\n\t * Always defined — the surface's own if it was given one, the console\n\t * logger otherwise — so nothing downstream has to decide what to do about a\n\t * missing one. The generated entry reads it from here.\n\t */\n\treadonly logger: Logger;\n\n\t/**\n\t * The environment parser every endpoint on this surface runs with.\n\t *\n\t * Always defined, and normally the default: `process.env` merged with the\n\t * credentials `gkm dev`/`gkm exec` injected. That is what every\n\t * application's own `config/env.ts` was — boilerplate identical in every\n\t * project, and mandatory, which is a poor combination.\n\t */\n\treadonly envParser: EnvironmentParser<{}>;\n\n\t/** The Telescope instance, when this surface was given one. */\n\treadonly telescope?: Telescope;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: RestApiConfig<TAuthorizers>,\n\t\t/** Internal: how `.calls()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t\t/** Internal: how `.auth()` carries the authenticator into its copy. */\n\t\tprivate readonly authenticator?: string,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\ttrustedOrigins: provideKey(canonical, 'trustedOrigins'),\n\t\t\tcookieDomain: provideKey(canonical, 'cookieDomain'),\n\t\t};\n\n\t\tthis.logger = config.logger ?? DEFAULT_LOGGER;\n\t\tthis.telescope = config.telescope;\n\t\tthis.envParser = envParserFor(\n\t\t\tconfig.envParser\n\t\t\t\t? { id: canonical, envParser: config.envParser }\n\t\t\t\t: undefined,\n\t\t);\n\n\t\tthis.#endpoints = new EndpointFactory({\n\t\t\tdefaultLogger: this.logger,\n\t\t\t...(config.authorizers\n\t\t\t\t? {\n\t\t\t\t\t\t// With the scheme a built-in name stands for, as the factory's own\n\t\t\t\t\t\t// `.authorizers()` resolves it. Bare names reached the OpenAPI\n\t\t\t\t\t\t// document with no scheme, so a guarded endpoint read as public.\n\t\t\t\t\t\tavailableAuthorizers: config.authorizers.map((name) => {\n\t\t\t\t\t\t\tconst securityScheme = getSecurityScheme(name);\n\t\t\t\t\t\t\treturn securityScheme ? { name, securityScheme } : { name };\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// `'none'` reaches the factory as no default at all, which is what\n\t\t\t// public means to an endpoint that names no authorizer.\n\t\t\t...(config.defaultAuthorizer && config.defaultAuthorizer !== 'none'\n\t\t\t\t? { defaultAuthorizerName: config.defaultAuthorizer }\n\t\t\t\t: {}),\n\t\t\tsurface: { id: this.id, envParser: this.envParser },\n\t\t});\n\n\t\tconst endpoints = this.#endpoints;\n\t\tthis.get = endpoints.get.bind(endpoints);\n\t\tthis.post = endpoints.post.bind(endpoints);\n\t\tthis.put = endpoints.put.bind(endpoints);\n\t\tthis.patch = endpoints.patch.bind(endpoints);\n\t\tthis.delete = endpoints.delete.bind(endpoints);\n\t\tthis.options = endpoints.options.bind(endpoints);\n\t\tthis.database = endpoints.database.bind(endpoints);\n\t\tthis.session = endpoints.session.bind(endpoints);\n\t\tthis.auditor = endpoints.auditor.bind(endpoints);\n\t\tthis.actor = endpoints.actor.bind(endpoints);\n\t\tthis.publisher = endpoints.publisher.bind(endpoints);\n\t\tthis.authorizer = endpoints.authorizer.bind(endpoints);\n\t\tthis.authorize = endpoints.authorize.bind(endpoints);\n\t\tthis.rls = endpoints.rls.bind(endpoints);\n\t\tthis.route = endpoints.route.bind(endpoints);\n\t}\n\n\t/**\n\t * This surface's endpoint factory, which every method below starts from.\n\t *\n\t * Private: a surface *is* where endpoints are built, so there is no second\n\t * object to reach through first. `api.database(db)` said the same\n\t * thing as `api.database(db)` with one more word to learn.\n\t */\n\treadonly #endpoints: Endpoints;\n\n\t/** `api.get('/users')` — one route on this surface. */\n\treadonly get: Endpoints['get'];\n\treadonly post: Endpoints['post'];\n\treadonly put: Endpoints['put'];\n\treadonly patch: Endpoints['patch'];\n\treadonly delete: Endpoints['delete'];\n\treadonly options: Endpoints['options'];\n\n\t/**\n\t * A branch for a *group* of endpoints that shares what a single route would\n\t * otherwise repeat — a database, an auditor, a publisher, a session:\n\t *\n\t * ```ts\n\t * export const router = api.database(database);\n\t * export const createUser = router.post('/users').handle(({ db }) => …);\n\t * ```\n\t *\n\t * Each returns a new factory and leaves the surface as it was. That is the\n\t * whole difference from putting the same thing in the surface's config: a\n\t * group opts in, where the surface would grant it to every route it serves —\n\t * a health check handed the database because a profile endpoint needed it.\n\t *\n\t * `dependsOn` is deliberately not here. It is per endpoint, and on the\n\t * surface it would read as the API depending on something, which is what\n\t * `.calls()` and `.auth()` say instead.\n\t */\n\treadonly database: Endpoints['database'];\n\treadonly session: Endpoints['session'];\n\treadonly auditor: Endpoints['auditor'];\n\treadonly actor: Endpoints['actor'];\n\treadonly publisher: Endpoints['publisher'];\n\treadonly authorizer: Endpoints['authorizer'];\n\treadonly authorize: Endpoints['authorize'];\n\treadonly rls: Endpoints['rls'];\n\treadonly route: Endpoints['route'];\n\n\t/**\n\t * What authenticates this surface.\n\t *\n\t * An edge like `.calls()` — the auth server learns this origin, and the two\n\t * share a cookie domain — but a named one, because *who authenticates me* is\n\t * a different fact from *who I happen to call*, and only one of them decides\n\t * what a request is allowed to be. A surface with two of the first is a\n\t * mistake; two of the second is Tuesday.\n\t *\n\t * It records the id, not a client. Every endpoint consumes the same thing —\n\t * `verify(request) → Session | null` — and that is what every provider\n\t * shares, whether the server is mounted in this process, deployed beside it,\n\t * or an OIDC issuer somebody else runs.\n\t */\n\tauth(construct: Declarable): RestApi<TName, TAuthorizers> {\n\t\treturn new RestApi<TName, TAuthorizers>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, edgeTo(construct)],\n\t\t\tconstruct.id,\n\t\t);\n\t}\n\n\t/**\n\t * Other surfaces this one calls.\n\t *\n\t * **Not `.dependsOn()`, and the difference matters.** An endpoint's\n\t * `.dependsOn()` injects a client into that handler and grants it exactly\n\t * what it named. This grants nothing and injects nothing: it records that\n\t * this API calls another surface, which is what puts this API's origin on\n\t * that surface's trusted-origin list.\n\t *\n\t * Spelling it `dependsOn` would invite the thing least privilege forbids —\n\t * every route on the surface receiving whatever the surface named.\n\t *\n\t * Immutable, like every other builder here.\n\t */\n\tcalls(constructs: readonly Declarable[]): RestApi<TName, TAuthorizers> {\n\t\treturn new RestApi<TName, TAuthorizers>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, ...constructs.map(edgeTo)],\n\t\t\tthis.authenticator,\n\t\t);\n\t}\n\n\t/**\n\t * One surface node, with its endpoints left to the build.\n\t *\n\t * The three provided keys are one fact about this surface and two about its\n\t * callers. Declaring the caller-derived pair here rather than having the\n\t * target invent them is what makes the contract checkable: a target that\n\t * resolves no origins is caught against this list instead of being noticed\n\t * when a browser is refused in production.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'rest-api',\n\t\t\t\tid: this.id,\n\t\t\t\tpath: this.config.path,\n\t\t\t\t...(this.config.telescope ? { telescope: true } : {}),\n\t\t\t\t...(this.config.cors ? { cors: this.config.cors } : {}),\n\t\t\t\t...(this.authenticator ? { auth: this.authenticator } : {}),\n\t\t\t\t// Filled by the build, which already generates one handler per\n\t\t\t\t// endpoint and knows the path it wrote it to. A surface that\n\t\t\t\t// enumerates its own routes statically — an auth server's single\n\t\t\t\t// wildcard — puts them here instead.\n\t\t\t\tendpoints: [],\n\t\t\t\t...(this.dependencies.length ? { calls: this.dependencies } : {}),\n\t\t\t\t...(this.config.authorizers?.length\n\t\t\t\t\t? { authorizers: this.config.authorizers }\n\t\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AC;GACrD,GAAI,KAAK,gBAAgB,EAAE,MAAM,KAAK,cAAc,IAAI,CAAC;GAKzD,WAAW,CAAC;GACZ,GAAI,KAAK,aAAa,SAAS,EAAE,OAAO,KAAK,aAAa,IAAI,CAAC;GAC/D,GAAI,KAAK,OAAO,aAAa,SAC1B,EAAE,aAAa,KAAK,OAAO,YAAY,IACvC,CAAC;GACJ,mBAAmB,KAAK,OAAO;GAC/B,UAAU;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;GACX;EACD,CACD;CACD;AACD"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_SubscriberBuilder = require("../SubscriberBuilder-C0ZEtGDI.cjs");
2
+ const require_SubscriberBuilder = require("../SubscriberBuilder-C2bCOuPT.cjs");
3
3
  exports.Subscriber = require_SubscriberBuilder.Subscriber;
4
4
  exports.SubscriberBuilder = require_SubscriberBuilder.SubscriberBuilder;
@@ -1,3 +1,3 @@
1
- import { t as Subscriber } from "../Subscriber-CotDUELC.cjs";
2
- import { t as SubscriberBuilder } from "../SubscriberBuilder-BEv0eoHy.cjs";
1
+ import { t as Subscriber } from "../Subscriber-DQCaiOXF.cjs";
2
+ import { t as SubscriberBuilder } from "../SubscriberBuilder-DQ7EWdGO.cjs";
3
3
  export { Subscriber, SubscriberBuilder };
@@ -1,3 +1,3 @@
1
- import { t as Subscriber } from "../Subscriber-C4heaAyO.mjs";
2
- import { t as SubscriberBuilder } from "../SubscriberBuilder-tyH5yTk5.mjs";
1
+ import { t as Subscriber } from "../Subscriber-CIO3pwji.mjs";
2
+ import { t as SubscriberBuilder } from "../SubscriberBuilder-COW4rHnb.mjs";
3
3
  export { Subscriber, SubscriberBuilder };
@@ -1,2 +1,2 @@
1
- import { n as Subscriber, t as SubscriberBuilder } from "../SubscriberBuilder-h7B_cHMr.mjs";
1
+ import { n as Subscriber, t as SubscriberBuilder } from "../SubscriberBuilder-B4YRTBng.mjs";
2
2
  export { Subscriber, SubscriberBuilder };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_Construct = require("../Construct-DqdlARxq.cjs");
2
+ const require_Construct = require("../Construct-yG9Sw-5p.cjs");
3
3
  const require_clone = require("../clone-UGJpvQnL.cjs");
4
4
  let _geekmidas_manifest = require("@geekmidas/manifest");
5
5
  let _geekmidas_logger_console = require("@geekmidas/logger/console");
@@ -1,3 +1,3 @@
1
- import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-DEVGo0Dm.cjs";
2
- import { n as TopicBuilder, t } from "../index-B2urf3YI.cjs";
1
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-D6blllEn.cjs";
2
+ import { n as TopicBuilder, t } from "../index-tE_119SX.cjs";
3
3
  export { Topic, TopicBuilder, type TopicEvents, type TopicMessage, t };
@@ -1,3 +1,3 @@
1
- import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-zk_6Gthr.mjs";
2
- import { n as TopicBuilder, t } from "../index-DMCDvnsM.mjs";
1
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-DVvheJ_-.mjs";
2
+ import { n as TopicBuilder, t } from "../index-fnpjXiA-.mjs";
3
3
  export { Topic, TopicBuilder, type TopicEvents, type TopicMessage, t };
@@ -1,4 +1,4 @@
1
- import { t as Construct } from "../Construct-BeYVu_QF.mjs";
1
+ import { t as Construct } from "../Construct-Detz65RA.mjs";
2
2
  import { t as cloneWith } from "../clone-EKNovYHu.mjs";
3
3
  import { canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
4
4
  import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
package/dist/worker.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_construct_interface = require("./construct-interface.cjs");
3
- const require_functions = require("./functions-B6qCvfmy.cjs");
3
+ const require_functions = require("./functions-VnOTEp74.cjs");
4
4
  const require_surfaceEnv = require("./surfaceEnv-CNimK76p.cjs");
5
- const require_CronBuilder = require("./CronBuilder-BdnI6lxF.cjs");
6
- const require_SubscriberBuilder = require("./SubscriberBuilder-C0ZEtGDI.cjs");
5
+ const require_CronBuilder = require("./CronBuilder-zdTdaT-e.cjs");
6
+ const require_SubscriberBuilder = require("./SubscriberBuilder-C2bCOuPT.cjs");
7
7
  let _geekmidas_manifest = require("@geekmidas/manifest");
8
8
  let _geekmidas_logger_console = require("@geekmidas/logger/console");
9
9
  //#region src/worker.ts
package/dist/worker.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
- import { a as FunctionHandler, r as Function, t as FunctionBuilder } from "./index-D_frT6MP.cjs";
2
+ import { a as FunctionHandler, r as Function, t as FunctionBuilder } from "./index-D9gxXK1m.cjs";
3
3
  import { n as Consumable, r as Declarable, s as ServicesOf } from "./construct-interface-DgXTJcOD.cjs";
4
- import { i as ScheduleExpression } from "./Cron-zsoSAwZo.cjs";
5
- import { t as CronBuilder } from "./CronBuilder-CyT71Nzg.cjs";
6
- import { n as TopicEvents, r as TopicMessage, t as Topic } from "./Topic-DEVGo0Dm.cjs";
7
- import { t as SubscriberBuilder } from "./SubscriberBuilder-BEv0eoHy.cjs";
8
- import "./index-B2urf3YI.cjs";
4
+ import { i as ScheduleExpression } from "./Cron-szLBpMSi.cjs";
5
+ import { t as CronBuilder } from "./CronBuilder-kqU9icLS.cjs";
6
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "./Topic-D6blllEn.cjs";
7
+ import { t as SubscriberBuilder } from "./SubscriberBuilder-DQ7EWdGO.cjs";
8
+ import "./index-tE_119SX.cjs";
9
9
  import { EnvironmentParser } from "@geekmidas/envkit";
10
10
  import { EventPublisher } from "@geekmidas/events";
11
11
  import { Logger } from "@geekmidas/logger";
package/dist/worker.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
- import { a as FunctionHandler, r as Function, t as FunctionBuilder } from "./index-DcyIYbDS.mjs";
2
+ import { a as FunctionHandler, r as Function, t as FunctionBuilder } from "./index-Df4DrCZd.mjs";
3
3
  import { n as Consumable, r as Declarable, s as ServicesOf } from "./construct-interface-DPlxfpoS.mjs";
4
- import { i as ScheduleExpression } from "./Cron-l4Wlz6G9.mjs";
5
- import { t as CronBuilder } from "./CronBuilder-UoNgFe8S.mjs";
6
- import { n as TopicEvents, r as TopicMessage, t as Topic } from "./Topic-zk_6Gthr.mjs";
7
- import { t as SubscriberBuilder } from "./SubscriberBuilder-tyH5yTk5.mjs";
8
- import "./index-DMCDvnsM.mjs";
4
+ import { i as ScheduleExpression } from "./Cron-DFFsKfMQ.mjs";
5
+ import { t as CronBuilder } from "./CronBuilder-Czxh8nnD.mjs";
6
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "./Topic-DVvheJ_-.mjs";
7
+ import { t as SubscriberBuilder } from "./SubscriberBuilder-COW4rHnb.mjs";
8
+ import "./index-fnpjXiA-.mjs";
9
9
  import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
10
10
  import { EnvironmentParser } from "@geekmidas/envkit";
11
11
  import { EventPublisher } from "@geekmidas/events";
package/dist/worker.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { edgeTo } from "./construct-interface.mjs";
2
- import { t as FunctionBuilder } from "./functions-C53GW2eQ.mjs";
2
+ import { t as FunctionBuilder } from "./functions-faoJOUmr.mjs";
3
3
  import { n as envParserFor } from "./surfaceEnv-wMT5QzgZ.mjs";
4
- import { t as CronBuilder } from "./CronBuilder-D_0HNBTr.mjs";
5
- import { t as SubscriberBuilder } from "./SubscriberBuilder-h7B_cHMr.mjs";
4
+ import { t as CronBuilder } from "./CronBuilder-vkjuo1UP.mjs";
5
+ import { t as SubscriberBuilder } from "./SubscriberBuilder-B4YRTBng.mjs";
6
6
  import { canonicalId } from "@geekmidas/manifest";
7
7
  import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
8
8
  //#region src/worker.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/constructs",
3
- "version": "10.0.0-alpha.18",
3
+ "version": "10.0.0-alpha.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -245,13 +245,13 @@
245
245
  "lodash.uniqby": "~4.7.0",
246
246
  "openapi-types": "~12.1.3",
247
247
  "qs": "~6.16.0",
248
- "@geekmidas/envkit": "^10.0.0-alpha.18",
249
- "@geekmidas/errors": "^10.0.0-alpha.18",
250
- "@geekmidas/events": "^10.0.0-alpha.18",
251
- "@geekmidas/logger": "^10.0.0-alpha.18",
252
- "@geekmidas/schema": "^10.0.0-alpha.18",
253
- "@geekmidas/manifest": "^10.0.0-alpha.18",
254
- "@geekmidas/services": "^10.0.0-alpha.18"
248
+ "@geekmidas/envkit": "^10.0.0-alpha.19",
249
+ "@geekmidas/errors": "^10.0.0-alpha.19",
250
+ "@geekmidas/events": "^10.0.0-alpha.19",
251
+ "@geekmidas/logger": "^10.0.0-alpha.19",
252
+ "@geekmidas/manifest": "^10.0.0-alpha.19",
253
+ "@geekmidas/schema": "^10.0.0-alpha.19",
254
+ "@geekmidas/services": "^10.0.0-alpha.19"
255
255
  },
256
256
  "devDependencies": {
257
257
  "@types/lodash.compact": "~3.0.9",
@@ -266,20 +266,20 @@
266
266
  "msw": "~2.15.0",
267
267
  "pg": "~8.23.0",
268
268
  "zod": "~4.6.5",
269
- "@geekmidas/audit": "^10.0.0-alpha.18",
270
- "@geekmidas/auth": "10.0.0-alpha.18",
271
- "@geekmidas/cache": "^10.0.0-alpha.18",
272
- "@geekmidas/db": "^10.0.0-alpha.18",
273
- "@geekmidas/envkit": "^10.0.0-alpha.18",
274
- "@geekmidas/errors": "^10.0.0-alpha.18",
275
- "@geekmidas/emailkit": "^10.0.0-alpha.18",
276
- "@geekmidas/events": "^10.0.0-alpha.18",
277
- "@geekmidas/logger": "^10.0.0-alpha.18",
278
- "@geekmidas/rate-limit": "^10.0.0-alpha.18",
279
- "@geekmidas/schema": "^10.0.0-alpha.18",
280
- "@geekmidas/services": "^10.0.0-alpha.18",
281
- "@geekmidas/telescope": "10.0.0-alpha.18",
282
- "@geekmidas/testkit": "^10.0.0-alpha.18"
269
+ "@geekmidas/audit": "^10.0.0-alpha.19",
270
+ "@geekmidas/auth": "10.0.0-alpha.19",
271
+ "@geekmidas/cache": "^10.0.0-alpha.19",
272
+ "@geekmidas/db": "^10.0.0-alpha.19",
273
+ "@geekmidas/emailkit": "^10.0.0-alpha.19",
274
+ "@geekmidas/envkit": "^10.0.0-alpha.19",
275
+ "@geekmidas/errors": "^10.0.0-alpha.19",
276
+ "@geekmidas/events": "^10.0.0-alpha.19",
277
+ "@geekmidas/logger": "^10.0.0-alpha.19",
278
+ "@geekmidas/rate-limit": "^10.0.0-alpha.19",
279
+ "@geekmidas/schema": "^10.0.0-alpha.19",
280
+ "@geekmidas/services": "^10.0.0-alpha.19",
281
+ "@geekmidas/telescope": "10.0.0-alpha.19",
282
+ "@geekmidas/testkit": "^10.0.0-alpha.19"
283
283
  },
284
284
  "peerDependencies": {
285
285
  "@middy/core": ">=7.9.2",
@@ -289,14 +289,14 @@
289
289
  "kysely": "~0.29.6",
290
290
  "msw": ">=2.15.0",
291
291
  "pg": ">=8.23.0",
292
- "@geekmidas/audit": "^10.0.0-alpha.18",
293
- "@geekmidas/auth": "10.0.0-alpha.18",
294
- "@geekmidas/cache": "^10.0.0-alpha.18",
295
- "@geekmidas/db": "^10.0.0-alpha.18",
296
- "@geekmidas/emailkit": "^10.0.0-alpha.18",
297
- "@geekmidas/rate-limit": "^10.0.0-alpha.18",
298
- "@geekmidas/storage": "^10.0.0-alpha.18",
299
- "@geekmidas/telescope": "10.0.0-alpha.18"
292
+ "@geekmidas/audit": "^10.0.0-alpha.19",
293
+ "@geekmidas/auth": "10.0.0-alpha.19",
294
+ "@geekmidas/cache": "^10.0.0-alpha.19",
295
+ "@geekmidas/db": "^10.0.0-alpha.19",
296
+ "@geekmidas/emailkit": "^10.0.0-alpha.19",
297
+ "@geekmidas/rate-limit": "^10.0.0-alpha.19",
298
+ "@geekmidas/storage": "^10.0.0-alpha.19",
299
+ "@geekmidas/telescope": "10.0.0-alpha.19"
300
300
  },
301
301
  "peerDependenciesMeta": {
302
302
  "@geekmidas/audit": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"Construct-BeYVu_QF.mjs","names":["compact"],"sources":["../../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js","../src/Construct.ts"],"sourcesContent":["/**\n * lodash 3.0.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n\n/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","import type { AuditStorage } from '@geekmidas/audit';\nimport {\n\tSnifferEnvironmentParser,\n\ttype SniffResult,\n\tsniffWithFireAndForget,\n} from '@geekmidas/envkit/sniffer';\nimport type { EventPublisher, MappedEvent } from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport type { Service, ServiceContext } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport compact from 'lodash.compact';\n\n// Cache for service environment variables to handle singleton services\n// Stores both the full list and the optional subset so the same sniff result\n// can satisfy both getEnvironment() and getEnvironment({ markOptional: true }).\nconst serviceEnvCache = new Map<\n\tService,\n\t{ envVars: string[]; optionalEnvVars: string[] }\n>();\n\n/**\n * Noop context for environment sniffing.\n * Used when calling service.register() to detect env vars without a real request.\n * Returns dummy values since services should only use context in instance methods,\n * not during registration.\n */\nconst snifferContext: ServiceContext = {\n\tgetLogger() {\n\t\t// Return a noop logger for sniffing - services shouldn't log during registration\n\t\treturn {\n\t\t\tdebug: () => {},\n\t\t\tinfo: () => {},\n\t\t\twarn: () => {},\n\t\t\terror: () => {},\n\t\t\tchild: () => snifferContext.getLogger(),\n\t\t} as unknown as Logger;\n\t},\n\tgetRequestId() {\n\t\treturn 'sniffer-context';\n\t},\n\tgetRequestStartTime() {\n\t\treturn Date.now();\n\t},\n\thasContext() {\n\t\treturn false;\n\t},\n};\n\nexport abstract class Construct<\n\tTLogger extends Logger = Logger,\n\tTServiceName extends string = string,\n\tT extends EventPublisher<any> | undefined = undefined,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTAuditStorageServiceName extends string = string,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTDatabaseServiceName extends string = string,\n\tTDatabase = unknown,\n> {\n\t/** Database service for this construct (used by Endpoint for RLS/audit context) */\n\tpublic databaseService?: Service<TDatabaseServiceName, TDatabase>;\n\n\t/**\n\t * The deploy unit that runs this, by construct id.\n\t *\n\t * What an endpoint's `surface` is to it, and for the same reason: something\n\t * has to say which process a runnable belongs to, and until this existed the\n\t * only thing that said so was the directory its file sat in. Set by the\n\t * factory it was built from — `worker.crons`, `api.endpoints` — so it is\n\t * carried rather than configured.\n\t *\n\t * Undefined for a construct built from a free-standing builder, which is\n\t * still how `c`, `s` and `f` work.\n\t */\n\tpublic owner?: string;\n\n\tconstructor(\n\t\tpublic readonly type: ConstructType,\n\t\tpublic readonly logger: TLogger,\n\t\tpublic readonly services: TServices,\n\t\tpublic readonly events: MappedEvent<T, any>[] = [],\n\t\tpublic readonly publisherService?: Service<TServiceName, T>,\n\t\tpublic outputSchema?: OutSchema,\n\t\tpublic readonly timeout?: number,\n\t\tpublic readonly memorySize?: number,\n\t\tpublic readonly auditorStorageService?: Service<\n\t\t\tTAuditStorageServiceName,\n\t\t\tTAuditStorage\n\t\t>,\n\t\t/**\n\t\t * The constructs this one declared an edge to, by id.\n\t\t *\n\t\t * What the manifest records. `services` is the same information in the\n\t\t * form a handler runs with — clients, keyed by name — and an id cannot be\n\t\t * recovered from one of those reliably, so both are kept.\n\t\t *\n\t\t * Last in the list because every other parameter is positional and already\n\t\t * spoken for; a new one anywhere else silently rebinds existing callers.\n\t\t */\n\t\tpublic readonly constructs: string[] = [],\n\t) {}\n\n\t/**\n\t * Returns an array of environment variable names required by this construct's services.\n\t * This is determined by running a \"sniffer\" EnvironmentParser through each service's\n\t * register method to track which environment variables are accessed.\n\t *\n\t * Results are cached per service class to handle singleton patterns where\n\t * subsequent register() calls may short-circuit and not access env vars.\n\t *\n\t * @param markOptional - When true, optional vars (those accessed via `.optional()` or\n\t * `.default()`) are suffixed with `?` in the returned array (e.g. `'PORT?'`).\n\t * @returns Promise that resolves to array of environment variable names, sorted alphabetically\n\t *\n\t * @example\n\t * ```typescript\n\t * const endpoint = e\n\t * .services([databaseService, authService])\n\t * .get('/users')\n\t * .handle(async () => []);\n\t *\n\t * await endpoint.getEnvironment(); // ['AUTH_SECRET', 'DATABASE_URL']\n\t * await endpoint.getEnvironment({ markOptional: true }); // ['AUTH_SECRET', 'DATABASE_URL', 'PORT?']\n\t * ```\n\t */\n\tasync getEnvironment(\n\t\topts: { markOptional?: boolean } = {},\n\t): Promise<string[]> {\n\t\tconst { markOptional = false } = opts;\n\t\tconst envVars = new Set<string>();\n\t\tconst optionalVars = new Set<string>();\n\t\tconst services: Service[] = compact([\n\t\t\t...this.services,\n\t\t\tthis.publisherService,\n\t\t\tthis.publisherService,\n\t\t\tthis.auditorStorageService,\n\t\t\tthis.databaseService,\n\t\t]);\n\n\t\ttry {\n\t\t\tfor (const service of services) {\n\t\t\t\t// Check cache first - handles singleton services that short-circuit\n\t\t\t\tif (serviceEnvCache.has(service)) {\n\t\t\t\t\tconst cached = serviceEnvCache.get(service)!;\n\t\t\t\t\tcached.envVars.forEach((v) => envVars.add(v));\n\t\t\t\t\tcached.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Use sniffService to properly handle all error scenarios\n\t\t\t\tconst result = await sniffService(service);\n\n\t\t\t\t// Log any issues for debugging\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{ error: result.error.message, service: service.serviceName },\n\t\t\t\t\t\t'Service threw error during env sniffing (env vars still captured)',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (result.unhandledRejections.length > 0) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrors: result.unhandledRejections.map((e) => e.message),\n\t\t\t\t\t\t\tservice: service.serviceName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'Fire-and-forget rejections during env sniffing (suppressed)',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Cache and collect env vars (both required and optional)\n\t\t\t\tserviceEnvCache.set(service, {\n\t\t\t\t\tenvVars: result.envVars,\n\t\t\t\t\toptionalEnvVars: result.optionalEnvVars,\n\t\t\t\t});\n\t\t\t\tresult.envVars.forEach((v) => envVars.add(v));\n\t\t\t\tresult.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t}\n\n\t\t\tconst sorted = Array.from(envVars).sort();\n\t\t\tif (!markOptional || optionalVars.size === 0) return sorted;\n\t\t\treturn sorted.map((v) => (optionalVars.has(v) ? `${v}?` : v));\n\t\t} catch (error) {\n\t\t\tthis.logger.error(\n\t\t\t\t{ error },\n\t\t\t\t'Error determining environment variables for construct',\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\t}\n}\n\nexport enum ConstructType {\n\tCron = 'dev.geekmidas.function.cron',\n\tEndpoint = 'dev.geekmidas.function.endpoint',\n\tFunction = 'dev.geekmidas.function.function',\n\tSubscriber = 'dev.geekmidas.function.subscriber',\n\tQueue = 'dev.geekmidas.function.queue',\n\tTopic = 'dev.geekmidas.resource.topic',\n}\n\n/**\n * Utility to test sniffing a service for environment variables.\n * Useful for debugging services that throw errors during sniffing.\n *\n * @example\n * ```typescript\n * import { sniffService } from '@geekmidas/constructs';\n * import { authService } from './services/AuthService';\n *\n * const result = await sniffService(authService);\n * console.log('Env vars:', result.envVars);\n * console.log('Error:', result.error);\n * ```\n */\nexport async function sniffService(service: Service): Promise<SniffResult> {\n\tconst sniffer = new SnifferEnvironmentParser();\n\n\treturn sniffWithFireAndForget(sniffer, () =>\n\t\tservice.register({\n\t\t\tenvParser: sniffer as any,\n\t\t\tcontext: snifferContext,\n\t\t}),\n\t);\n}\n\n// Export for testing\nexport { snifferContext };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBA,SAAS,QAAQ,OAAO;EACtB,IAAI,QAAQ,IACR,SAAS,QAAQ,MAAM,SAAS,GAChC,WAAW,GACX,SAAS,CAAC;EAEd,OAAO,EAAE,QAAQ,QAAQ;GACvB,IAAI,QAAQ,MAAM;GAClB,IAAI,OACF,OAAO,cAAc;EAEzB;EACA,OAAO;CACT;CAEA,OAAO,UAAU;;ACvBjB,MAAM,kCAAkB,IAAI,IAG1B;;;;;;;AAQF,MAAM,iBAAiC;CACtC,YAAY;EAEX,OAAO;GACN,aAAa,CAAC;GACd,YAAY,CAAC;GACb,YAAY,CAAC;GACb,aAAa,CAAC;GACd,aAAa,eAAe,UAAU;EACvC;CACD;CACA,eAAe;EACd,OAAO;CACR;CACA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QAAQ;IAClB,GACA,6DACD;IAID,gBAAgB,IAAI,SAAS;KAC5B,SAAS,OAAO;KAChB,iBAAiB,OAAO;IACzB,CAAC;IACD,OAAO,QAAQ,SAAS,MAAM,QAAQ,IAAI,CAAC,CAAC;IAC5C,OAAO,gBAAgB,SAAS,MAAM,aAAa,IAAI,CAAC,CAAC;GAC1D;GAEA,MAAM,SAAS,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK;GACxC,IAAI,CAAC,gBAAgB,aAAa,SAAS,GAAG,OAAO;GACrD,OAAO,OAAO,KAAK,MAAO,aAAa,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,CAAE;EAC7D,SAAS,OAAO;GACf,KAAK,OAAO,MACX,EAAE,MAAM,GACR,uDACD;GAEA,OAAO,CAAC;EACT;CACD;AACD;AAEA,IAAY,gBAAL,yBAAA,eAAA;CACN,cAAA,UAAA;CACA,cAAA,cAAA;CACA,cAAA,cAAA;CACA,cAAA,gBAAA;CACA,cAAA,WAAA;CACA,cAAA,WAAA;;AACD,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;AAgBA,eAAsB,aAAa,SAAwC;CAC1E,MAAM,UAAU,IAAI,yBAAyB;CAE7C,OAAO,uBAAuB,eAC7B,QAAQ,SAAS;EAChB,WAAW;EACX,SAAS;CACV,CAAC,CACF;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Construct-DqdlARxq.cjs","names":["compact","SnifferEnvironmentParser","sniffWithFireAndForget"],"sources":["../../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js","../src/Construct.ts"],"sourcesContent":["/**\n * lodash 3.0.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n\n/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","import type { AuditStorage } from '@geekmidas/audit';\nimport {\n\tSnifferEnvironmentParser,\n\ttype SniffResult,\n\tsniffWithFireAndForget,\n} from '@geekmidas/envkit/sniffer';\nimport type { EventPublisher, MappedEvent } from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport type { Service, ServiceContext } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport compact from 'lodash.compact';\n\n// Cache for service environment variables to handle singleton services\n// Stores both the full list and the optional subset so the same sniff result\n// can satisfy both getEnvironment() and getEnvironment({ markOptional: true }).\nconst serviceEnvCache = new Map<\n\tService,\n\t{ envVars: string[]; optionalEnvVars: string[] }\n>();\n\n/**\n * Noop context for environment sniffing.\n * Used when calling service.register() to detect env vars without a real request.\n * Returns dummy values since services should only use context in instance methods,\n * not during registration.\n */\nconst snifferContext: ServiceContext = {\n\tgetLogger() {\n\t\t// Return a noop logger for sniffing - services shouldn't log during registration\n\t\treturn {\n\t\t\tdebug: () => {},\n\t\t\tinfo: () => {},\n\t\t\twarn: () => {},\n\t\t\terror: () => {},\n\t\t\tchild: () => snifferContext.getLogger(),\n\t\t} as unknown as Logger;\n\t},\n\tgetRequestId() {\n\t\treturn 'sniffer-context';\n\t},\n\tgetRequestStartTime() {\n\t\treturn Date.now();\n\t},\n\thasContext() {\n\t\treturn false;\n\t},\n};\n\nexport abstract class Construct<\n\tTLogger extends Logger = Logger,\n\tTServiceName extends string = string,\n\tT extends EventPublisher<any> | undefined = undefined,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTAuditStorageServiceName extends string = string,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTDatabaseServiceName extends string = string,\n\tTDatabase = unknown,\n> {\n\t/** Database service for this construct (used by Endpoint for RLS/audit context) */\n\tpublic databaseService?: Service<TDatabaseServiceName, TDatabase>;\n\n\t/**\n\t * The deploy unit that runs this, by construct id.\n\t *\n\t * What an endpoint's `surface` is to it, and for the same reason: something\n\t * has to say which process a runnable belongs to, and until this existed the\n\t * only thing that said so was the directory its file sat in. Set by the\n\t * factory it was built from — `worker.crons`, `api.endpoints` — so it is\n\t * carried rather than configured.\n\t *\n\t * Undefined for a construct built from a free-standing builder, which is\n\t * still how `c`, `s` and `f` work.\n\t */\n\tpublic owner?: string;\n\n\tconstructor(\n\t\tpublic readonly type: ConstructType,\n\t\tpublic readonly logger: TLogger,\n\t\tpublic readonly services: TServices,\n\t\tpublic readonly events: MappedEvent<T, any>[] = [],\n\t\tpublic readonly publisherService?: Service<TServiceName, T>,\n\t\tpublic outputSchema?: OutSchema,\n\t\tpublic readonly timeout?: number,\n\t\tpublic readonly memorySize?: number,\n\t\tpublic readonly auditorStorageService?: Service<\n\t\t\tTAuditStorageServiceName,\n\t\t\tTAuditStorage\n\t\t>,\n\t\t/**\n\t\t * The constructs this one declared an edge to, by id.\n\t\t *\n\t\t * What the manifest records. `services` is the same information in the\n\t\t * form a handler runs with — clients, keyed by name — and an id cannot be\n\t\t * recovered from one of those reliably, so both are kept.\n\t\t *\n\t\t * Last in the list because every other parameter is positional and already\n\t\t * spoken for; a new one anywhere else silently rebinds existing callers.\n\t\t */\n\t\tpublic readonly constructs: string[] = [],\n\t) {}\n\n\t/**\n\t * Returns an array of environment variable names required by this construct's services.\n\t * This is determined by running a \"sniffer\" EnvironmentParser through each service's\n\t * register method to track which environment variables are accessed.\n\t *\n\t * Results are cached per service class to handle singleton patterns where\n\t * subsequent register() calls may short-circuit and not access env vars.\n\t *\n\t * @param markOptional - When true, optional vars (those accessed via `.optional()` or\n\t * `.default()`) are suffixed with `?` in the returned array (e.g. `'PORT?'`).\n\t * @returns Promise that resolves to array of environment variable names, sorted alphabetically\n\t *\n\t * @example\n\t * ```typescript\n\t * const endpoint = e\n\t * .services([databaseService, authService])\n\t * .get('/users')\n\t * .handle(async () => []);\n\t *\n\t * await endpoint.getEnvironment(); // ['AUTH_SECRET', 'DATABASE_URL']\n\t * await endpoint.getEnvironment({ markOptional: true }); // ['AUTH_SECRET', 'DATABASE_URL', 'PORT?']\n\t * ```\n\t */\n\tasync getEnvironment(\n\t\topts: { markOptional?: boolean } = {},\n\t): Promise<string[]> {\n\t\tconst { markOptional = false } = opts;\n\t\tconst envVars = new Set<string>();\n\t\tconst optionalVars = new Set<string>();\n\t\tconst services: Service[] = compact([\n\t\t\t...this.services,\n\t\t\tthis.publisherService,\n\t\t\tthis.publisherService,\n\t\t\tthis.auditorStorageService,\n\t\t\tthis.databaseService,\n\t\t]);\n\n\t\ttry {\n\t\t\tfor (const service of services) {\n\t\t\t\t// Check cache first - handles singleton services that short-circuit\n\t\t\t\tif (serviceEnvCache.has(service)) {\n\t\t\t\t\tconst cached = serviceEnvCache.get(service)!;\n\t\t\t\t\tcached.envVars.forEach((v) => envVars.add(v));\n\t\t\t\t\tcached.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Use sniffService to properly handle all error scenarios\n\t\t\t\tconst result = await sniffService(service);\n\n\t\t\t\t// Log any issues for debugging\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{ error: result.error.message, service: service.serviceName },\n\t\t\t\t\t\t'Service threw error during env sniffing (env vars still captured)',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (result.unhandledRejections.length > 0) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrors: result.unhandledRejections.map((e) => e.message),\n\t\t\t\t\t\t\tservice: service.serviceName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'Fire-and-forget rejections during env sniffing (suppressed)',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Cache and collect env vars (both required and optional)\n\t\t\t\tserviceEnvCache.set(service, {\n\t\t\t\t\tenvVars: result.envVars,\n\t\t\t\t\toptionalEnvVars: result.optionalEnvVars,\n\t\t\t\t});\n\t\t\t\tresult.envVars.forEach((v) => envVars.add(v));\n\t\t\t\tresult.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t}\n\n\t\t\tconst sorted = Array.from(envVars).sort();\n\t\t\tif (!markOptional || optionalVars.size === 0) return sorted;\n\t\t\treturn sorted.map((v) => (optionalVars.has(v) ? `${v}?` : v));\n\t\t} catch (error) {\n\t\t\tthis.logger.error(\n\t\t\t\t{ error },\n\t\t\t\t'Error determining environment variables for construct',\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\t}\n}\n\nexport enum ConstructType {\n\tCron = 'dev.geekmidas.function.cron',\n\tEndpoint = 'dev.geekmidas.function.endpoint',\n\tFunction = 'dev.geekmidas.function.function',\n\tSubscriber = 'dev.geekmidas.function.subscriber',\n\tQueue = 'dev.geekmidas.function.queue',\n\tTopic = 'dev.geekmidas.resource.topic',\n}\n\n/**\n * Utility to test sniffing a service for environment variables.\n * Useful for debugging services that throw errors during sniffing.\n *\n * @example\n * ```typescript\n * import { sniffService } from '@geekmidas/constructs';\n * import { authService } from './services/AuthService';\n *\n * const result = await sniffService(authService);\n * console.log('Env vars:', result.envVars);\n * console.log('Error:', result.error);\n * ```\n */\nexport async function sniffService(service: Service): Promise<SniffResult> {\n\tconst sniffer = new SnifferEnvironmentParser();\n\n\treturn sniffWithFireAndForget(sniffer, () =>\n\t\tservice.register({\n\t\t\tenvParser: sniffer as any,\n\t\t\tcontext: snifferContext,\n\t\t}),\n\t);\n}\n\n// Export for testing\nexport { snifferContext };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CAuBA,SAAS,QAAQ,OAAO;EACtB,IAAI,QAAQ,IACR,SAAS,QAAQ,MAAM,SAAS,GAChC,WAAW,GACX,SAAS,CAAC;EAEd,OAAO,EAAE,QAAQ,QAAQ;GACvB,IAAI,QAAQ,MAAM;GAClB,IAAI,OACF,OAAO,cAAc;EAEzB;EACA,OAAO;CACT;CAEA,OAAO,UAAU;;;;;ACvBjB,MAAM,kCAAkB,IAAI,IAG1B;;;;;;;AAQF,MAAM,iBAAiC;CACtC,YAAY;EAEX,OAAO;GACN,aAAa,CAAC;GACd,YAAY,CAAC;GACb,YAAY,CAAC;GACb,aAAa,CAAC;GACd,aAAa,eAAe,UAAU;EACvC;CACD;CACA,eAAe;EACd,OAAO;CACR;CACA,sBAAsB;EACrB,OAAO,KAAK,IAAI;CACjB;CACA,aAAa;EACZ,OAAO;CACR;AACD;AAEA,IAAsB,YAAtB,MAUE;CAmBgB;CACA;CACA;CACA;CACA;CACT;CACS;CACA;CACA;CAcA;;CAvCjB;;;;;;;;;;;;;CAcA;CAEA,YACC,MACA,QACA,UACA,SAAgD,CAAC,GACjD,kBACA,cACA,SACA,YACA,uBAcA,aAAuC,CAAC,GACvC;EAvBe,KAAA,OAAA;EACA,KAAA,SAAA;EACA,KAAA,WAAA;EACA,KAAA,SAAA;EACA,KAAA,mBAAA;EACT,KAAA,eAAA;EACS,KAAA,UAAA;EACA,KAAA,aAAA;EACA,KAAA,wBAAA;EAcA,KAAA,aAAA;CACd;;;;;;;;;;;;;;;;;;;;;;;;CAyBH,MAAM,eACL,OAAmC,CAAC,GAChB;EACpB,MAAM,EAAE,eAAe,UAAU;EACjC,MAAM,0BAAU,IAAI,IAAY;EAChC,MAAM,+BAAe,IAAI,IAAY;EACrC,MAAM,YAAA,GAAsBA,sBAAAA,QAAAA,CAAQ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A;;;;;;;;;;;;;;;AAgBA,eAAsB,aAAa,SAAwC;CAC1E,MAAM,UAAU,IAAIC,0BAAAA,yBAAyB;CAE7C,QAAA,GAAOC,0BAAAA,uBAAAA,CAAuB,eAC7B,QAAQ,SAAS;EAChB,WAAW;EACX,SAAS;CACV,CAAC,CACF;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-C1ZwNOOk.d.cts","names":[],"sources":["../src/publisher.ts","../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointFactory.ts","../src/endpoints/lazyAccessors.ts","../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;;;;iBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;cC5CrB,gBACZ,uBACA,gBAAgB,YAChB,eAAe,sBACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,qBAAqB,mCAAmC,kCAIxD,uBACA,sDACS,oBACT,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA;WA6BU,OAAO;WACP,QAAQ;YA5BR,SAAS;YACT;YACA,UAAU;YACV;YACA;YACA;EACV,aAAa,UAAU,WAAW,SAAS,UAAU;EAErD,YAAY,YAAY,WAAW,SAAS,UAAU,QAAQ;EAE9D,aAAa;EACb,uBAAuB;EACvB,kBAAkB;EAClB,kBAAkB,eAAe,WAAW,UAAU;EACtD,SAAS,YAAY,cAAc;;;;;;;EAOnC,UAAW;EACX,wBAAwB,eAAe;EACvC,aAAa,UAAU,WAAW,UAAU;EAC5C;EAEA,YACU,OAAO,QACP,QAAQ;EAMlB,cACC,WAAW,QAAQ,4BAA4B;EAMhD,mBACC,SAAS,QAAQ,0BAA0B;EAM5C,oBAAoB,SAAS,QAAQ,sBAAsB;EAI3D,YAAY;EAIZ,OAAO,QAAQ;EAIN,MAAM,eAAe,YAAY,iBAAiB,YAC1D,OAAO;EAOR,KAAK;EAIL,WAAW;;;;;;;;;;;;;;;;;;;EAsBX,aAAa;EAIJ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,GACA,OACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,KAAK,UAAU,kBACd,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAoB,MAAM;KAC/B,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,MAAM,UAAU,kBACf,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAKD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAsB,QAAQ;KACnC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,UACC,IAAI,YAAY,WAAW,SAAS,UAAU,QAAQ;EAKvD,UAAU,QAAQ;EAIlB,WACC,MAAM,gCACJ,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,cACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAoCD,QAAQ,GACP,SAAS,UAAU,WAAW,SAAS,GAAG,aACxC,gBACF,WACA,WACA,SACA,GACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,GAAG;;;;;EAmDzB,SAAS,GAAG,sBACX,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA,OACA,kBACA;;;;;;EAgDD,QAAQ,UAAU,mBAAmB,sBACpC,SAAS,QAAQ,OAAO,KACtB,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA,sBACA,kBACA;;;;;EA6CD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;;;EAsDD,IAAI,gBAAgB,UAAU,WAAW,UAAU,UAClD,QAAQ,UACN,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;UAoCO;EAsGR,KAAK,sBAAsB,MAAM,QAAK,gBAAA,oBAAA,uBAAA,QAAA,mBAAA,YAAA,wBAAA,6BAAA,YAAA,UAAA,2BA2CN,UAAI,wBACN,YAAI,QAAA,YAAA,QAAA,UAAA,wBA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UAAI,wBACN,YAAI,QAAA,YAAA,QAAA,UAAA,wBAAA,cAAA,aAAA,cAAA,aAAA,yBAAA,WAAA,oBAAA,UAAA,iBAAA,4BAAA,cAAA,eAAA,0BAAA,cAAA,WAAA;;KAnBvB,oBAAoB,oBAAoB,mBAAmB,UACpE,kBACC,IACA,OACD;KAES,UACX,0BACA,wBACG,oBACH,uBACG,QACA,mBACC,YACA,wBACC,6BACC,YACI,UACL,2BAA2B,UAC1B,wBAAwB,YACpB,QAAQ,YACR,QAAQ,UACZ,wBAAwB,YACpB,aAAa,YACb,aAAa;UAGP,uBAChB,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;EAGlC,kBAAkB;;EAElB;EACA,WAAW;EACX,qBAAqB,YACpB,WACA,SACA,qBAEA;EAED,gBAAgB;EAChB,0BAA0B,UAAU,WAAW,SAAS,UAAU;EAClE,wBAAwB,QAAQ,4BAA4B;EAC5D,gBAAgB,YAAY;EAC5B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB,QAAQ,0BAA0B;EAC1D,yBAAyB,QAAQ,sBAAsB;EACvD,wBAAwB,eAAe,WAAW,UAAU;EAC5D,wBAAwB;EACxB,mBAAmB;;;;;;;;;;;EAWnB,SAAS;;;;;;;;;iBC7uCM,kBAAkB,GAAG,UAAU;;;;;;iBAqB/B,kBAAkB,GAAG,UAAU;;;;;iBAgC/B,wBACf,SAAS,wDACP;;;;;iBAoCa,wBACf,+BACA,mCACE;;;;iBAmHa,qBAAqB;;;;iBAUrB,qBAAqB;;;;;;;;;;iBC1MrB,oBAAoB;;iBASpB,aACf,SAAS,8BACP"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Cc4kKPag.d.mts","names":[],"sources":["../src/publisher.ts","../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointFactory.ts","../src/endpoints/lazyAccessors.ts","../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;;;;iBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;cC5CrB,gBACZ,uBACA,gBAAgB,YAChB,eAAe,sBACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,qBAAqB,mCAAmC,kCAIxD,uBACA,sDACS,oBACT,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA;WA6BU,OAAO;WACP,QAAQ;YA5BR,SAAS;YACT;YACA,UAAU;YACV;YACA;YACA;EACV,aAAa,UAAU,WAAW,SAAS,UAAU;EAErD,YAAY,YAAY,WAAW,SAAS,UAAU,QAAQ;EAE9D,aAAa;EACb,uBAAuB;EACvB,kBAAkB;EAClB,kBAAkB,eAAe,WAAW,UAAU;EACtD,SAAS,YAAY,cAAc;;;;;;;EAOnC,UAAW;EACX,wBAAwB,eAAe;EACvC,aAAa,UAAU,WAAW,UAAU;EAC5C;EAEA,YACU,OAAO,QACP,QAAQ;EAMlB,cACC,WAAW,QAAQ,4BAA4B;EAMhD,mBACC,SAAS,QAAQ,0BAA0B;EAM5C,oBAAoB,SAAS,QAAQ,sBAAsB;EAI3D,YAAY;EAIZ,OAAO,QAAQ;EAIN,MAAM,eAAe,YAAY,iBAAiB,YAC1D,OAAO;EAOR,KAAK;EAIL,WAAW;;;;;;;;;;;;;;;;;;;EAsBX,aAAa;EAIJ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,GACA,OACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,KAAK,UAAU,kBACd,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAoB,MAAM;KAC/B,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,MAAM,UAAU,kBACf,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAKD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAsB,QAAQ;KACnC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,UACC,IAAI,YAAY,WAAW,SAAS,UAAU,QAAQ;EAKvD,UAAU,QAAQ;EAIlB,WACC,MAAM,gCACJ,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,c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