@encore.dev/sdk 2.0.0-beta.14 → 2.0.0-beta.16

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 (269) hide show
  1. package/README.md +144 -90
  2. package/app_meta.ts +56 -54
  3. package/config/config.test.ts +47 -13
  4. package/config/config.ts +60 -57
  5. package/config/secrets.ts +47 -50
  6. package/config/value.ts +23 -26
  7. package/cron/mod.test.ts +12 -0
  8. package/cron/mod.ts +37 -22
  9. package/dist/app_meta.d.ts +52 -50
  10. package/dist/app_meta.d.ts.map +1 -1
  11. package/dist/app_meta.js +2 -2
  12. package/dist/app_meta.js.map +1 -1
  13. package/dist/config/config.d.ts +58 -55
  14. package/dist/config/config.d.ts.map +1 -1
  15. package/dist/config/config.js +8 -9
  16. package/dist/config/config.js.map +1 -1
  17. package/dist/config/secrets.d.ts +45 -50
  18. package/dist/config/secrets.d.ts.map +1 -1
  19. package/dist/config/secrets.js +11 -9
  20. package/dist/config/secrets.js.map +1 -1
  21. package/dist/config/value.d.ts +20 -23
  22. package/dist/config/value.d.ts.map +1 -1
  23. package/dist/config/value.js +20 -23
  24. package/dist/config/value.js.map +1 -1
  25. package/dist/cron/mod.d.ts +34 -20
  26. package/dist/cron/mod.d.ts.map +1 -1
  27. package/dist/cron/mod.js +13 -13
  28. package/dist/cron/mod.js.map +1 -1
  29. package/dist/frontends/mod.d.ts +20 -19
  30. package/dist/frontends/mod.d.ts.map +1 -1
  31. package/dist/frontends/mod.js +20 -19
  32. package/dist/frontends/mod.js.map +1 -1
  33. package/dist/gateway/errors.d.ts +28 -30
  34. package/dist/gateway/errors.d.ts.map +1 -1
  35. package/dist/gateway/errors.js +29 -31
  36. package/dist/gateway/errors.js.map +1 -1
  37. package/dist/gateway/match.d.ts +54 -54
  38. package/dist/gateway/match.d.ts.map +1 -1
  39. package/dist/gateway/match.js +56 -56
  40. package/dist/gateway/match.js.map +1 -1
  41. package/dist/gateway/middleware.d.ts +62 -64
  42. package/dist/gateway/middleware.d.ts.map +1 -1
  43. package/dist/gateway/middleware.js +1 -1
  44. package/dist/gateway/middleware.js.map +1 -1
  45. package/dist/gateway/mod.d.ts +64 -67
  46. package/dist/gateway/mod.d.ts.map +1 -1
  47. package/dist/gateway/mod.js +72 -76
  48. package/dist/gateway/mod.js.map +1 -1
  49. package/dist/gateway/request.d.ts +138 -134
  50. package/dist/gateway/request.d.ts.map +1 -1
  51. package/dist/gateway/request.js +117 -108
  52. package/dist/gateway/request.js.map +1 -1
  53. package/dist/gateway/serve.d.ts +29 -34
  54. package/dist/gateway/serve.d.ts.map +1 -1
  55. package/dist/gateway/serve.js +51 -56
  56. package/dist/gateway/serve.js.map +1 -1
  57. package/dist/gateways/mod.d.ts +23 -21
  58. package/dist/gateways/mod.d.ts.map +1 -1
  59. package/dist/gateways/mod.js +25 -23
  60. package/dist/gateways/mod.js.map +1 -1
  61. package/dist/internal/otel/http.d.ts +4 -2
  62. package/dist/internal/otel/http.d.ts.map +1 -1
  63. package/dist/internal/otel/http.js +32 -5
  64. package/dist/internal/otel/http.js.map +1 -1
  65. package/dist/internal/runtime/napi/napi.cjs +6 -5
  66. package/dist/internal/runtime/napi/napi.d.cts +58 -16
  67. package/dist/internal/runtime/shutdown.d.ts +75 -57
  68. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  69. package/dist/internal/runtime/shutdown.js +88 -84
  70. package/dist/internal/runtime/shutdown.js.map +1 -1
  71. package/dist/log/logger.d.ts +43 -37
  72. package/dist/log/logger.d.ts.map +1 -1
  73. package/dist/log/logger.js +26 -25
  74. package/dist/log/logger.js.map +1 -1
  75. package/dist/metrics/mod.d.ts +133 -114
  76. package/dist/metrics/mod.d.ts.map +1 -1
  77. package/dist/metrics/mod.js +109 -101
  78. package/dist/metrics/mod.js.map +1 -1
  79. package/dist/otel.d.ts +6 -3
  80. package/dist/otel.d.ts.map +1 -1
  81. package/dist/otel.js +6 -3
  82. package/dist/otel.js.map +1 -1
  83. package/dist/pubsub/subscription.d.ts +88 -116
  84. package/dist/pubsub/subscription.d.ts.map +1 -1
  85. package/dist/pubsub/subscription.js +14 -17
  86. package/dist/pubsub/subscription.js.map +1 -1
  87. package/dist/pubsub/topic.d.ts +86 -113
  88. package/dist/pubsub/topic.d.ts.map +1 -1
  89. package/dist/pubsub/topic.js +68 -82
  90. package/dist/pubsub/topic.js.map +1 -1
  91. package/dist/redaction/mod.d.ts +62 -0
  92. package/dist/redaction/mod.d.ts.map +1 -0
  93. package/dist/redaction/mod.js +102 -0
  94. package/dist/redaction/mod.js.map +1 -0
  95. package/dist/reqctx/mod.d.ts +83 -86
  96. package/dist/reqctx/mod.d.ts.map +1 -1
  97. package/dist/reqctx/mod.js +39 -41
  98. package/dist/reqctx/mod.js.map +1 -1
  99. package/dist/services/index.d.ts +76 -75
  100. package/dist/services/index.d.ts.map +1 -1
  101. package/dist/services/index.js +73 -71
  102. package/dist/services/index.js.map +1 -1
  103. package/dist/shutdown/mod.d.ts +26 -25
  104. package/dist/shutdown/mod.d.ts.map +1 -1
  105. package/dist/shutdown/mod.js +26 -25
  106. package/dist/shutdown/mod.js.map +1 -1
  107. package/dist/storage/clickhouse/database.d.ts +113 -115
  108. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  109. package/dist/storage/clickhouse/database.js +65 -79
  110. package/dist/storage/clickhouse/database.js.map +1 -1
  111. package/dist/storage/clickhouse/errors.d.ts +25 -26
  112. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  113. package/dist/storage/clickhouse/errors.js +15 -17
  114. package/dist/storage/clickhouse/errors.js.map +1 -1
  115. package/dist/storage/clickhouse/mod.d.ts +10 -10
  116. package/dist/storage/clickhouse/mod.js +10 -10
  117. package/dist/storage/objects/bucket.d.ts +230 -203
  118. package/dist/storage/objects/bucket.d.ts.map +1 -1
  119. package/dist/storage/objects/bucket.js +146 -106
  120. package/dist/storage/objects/bucket.js.map +1 -1
  121. package/dist/storage/objects/error.d.ts +4 -4
  122. package/dist/storage/objects/error.js +4 -4
  123. package/dist/storage/objects/mod.d.ts +1 -1
  124. package/dist/storage/objects/mod.d.ts.map +1 -1
  125. package/dist/storage/objects/mod.js.map +1 -1
  126. package/dist/storage/objects/refs.d.ts +2 -5
  127. package/dist/storage/objects/refs.d.ts.map +1 -1
  128. package/dist/storage/objects/refs.js.map +1 -1
  129. package/dist/storage/postgres/database.d.ts +124 -149
  130. package/dist/storage/postgres/database.d.ts.map +1 -1
  131. package/dist/storage/postgres/database.js +98 -135
  132. package/dist/storage/postgres/database.js.map +1 -1
  133. package/dist/storage/postgres/errors.d.ts +42 -48
  134. package/dist/storage/postgres/errors.d.ts.map +1 -1
  135. package/dist/storage/postgres/errors.js +44 -51
  136. package/dist/storage/postgres/errors.js.map +1 -1
  137. package/dist/storage/postgres/interval.d.ts +19 -19
  138. package/dist/storage/postgres/interval.d.ts.map +1 -1
  139. package/dist/storage/postgres/interval.js +21 -21
  140. package/dist/storage/postgres/interval.js.map +1 -1
  141. package/dist/storage/redis/bitfield.d.ts +48 -23
  142. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  143. package/dist/storage/redis/bitfield.js +38 -19
  144. package/dist/storage/redis/bitfield.js.map +1 -1
  145. package/dist/storage/redis/command.d.ts +16 -12
  146. package/dist/storage/redis/command.d.ts.map +1 -1
  147. package/dist/storage/redis/command.js +16 -12
  148. package/dist/storage/redis/command.js.map +1 -1
  149. package/dist/storage/redis/commands.d.ts +99 -100
  150. package/dist/storage/redis/commands.d.ts.map +1 -1
  151. package/dist/storage/redis/commands.js +84 -85
  152. package/dist/storage/redis/commands.js.map +1 -1
  153. package/dist/storage/redis/database.d.ts +138 -122
  154. package/dist/storage/redis/database.d.ts.map +1 -1
  155. package/dist/storage/redis/database.js +120 -101
  156. package/dist/storage/redis/database.js.map +1 -1
  157. package/dist/storage/redis/mod.d.ts +52 -48
  158. package/dist/storage/redis/mod.d.ts.map +1 -1
  159. package/dist/storage/redis/mod.js +52 -48
  160. package/dist/storage/redis/mod.js.map +1 -1
  161. package/dist/storage/redis/options.d.ts +26 -24
  162. package/dist/storage/redis/options.d.ts.map +1 -1
  163. package/dist/storage/redis/options.js.map +1 -1
  164. package/dist/storage/redis/pubsub.d.ts +16 -16
  165. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  166. package/dist/storage/redis/pubsub.js +14 -14
  167. package/dist/storage/redis/pubsub.js.map +1 -1
  168. package/dist/storage/redis/reply.d.ts +80 -72
  169. package/dist/storage/redis/reply.d.ts.map +1 -1
  170. package/dist/storage/redis/reply.js +53 -46
  171. package/dist/storage/redis/reply.js.map +1 -1
  172. package/dist/storage/redis/scan.d.ts +4 -4
  173. package/dist/storage/redis/scan.d.ts.map +1 -1
  174. package/dist/storage/redis/scan.js +6 -6
  175. package/dist/storage/redis/scan.js.map +1 -1
  176. package/dist/storage/redis/script.d.ts +28 -21
  177. package/dist/storage/redis/script.d.ts.map +1 -1
  178. package/dist/storage/redis/script.js +29 -22
  179. package/dist/storage/redis/script.js.map +1 -1
  180. package/dist/storage/redis/target.d.ts +17 -1
  181. package/dist/storage/redis/target.d.ts.map +1 -1
  182. package/dist/storage/redis/target.js +30 -1
  183. package/dist/storage/redis/target.js.map +1 -1
  184. package/dist/storage/redis/wire.d.ts +6 -6
  185. package/dist/storage/redis/wire.d.ts.map +1 -1
  186. package/dist/storage/redis/wire.js +6 -6
  187. package/dist/storage/redis/wire.js.map +1 -1
  188. package/dist/testing/mod.d.ts +83 -88
  189. package/dist/testing/mod.d.ts.map +1 -1
  190. package/dist/testing/mod.js +75 -81
  191. package/dist/testing/mod.js.map +1 -1
  192. package/dist/testing/playwright.d.ts +28 -32
  193. package/dist/testing/playwright.d.ts.map +1 -1
  194. package/dist/testing/playwright.js +22 -27
  195. package/dist/testing/playwright.js.map +1 -1
  196. package/dist/testing/puppeteer.d.ts +11 -12
  197. package/dist/testing/puppeteer.d.ts.map +1 -1
  198. package/dist/testing/puppeteer.js +17 -18
  199. package/dist/testing/puppeteer.js.map +1 -1
  200. package/dist/testing/system.d.ts +72 -90
  201. package/dist/testing/system.d.ts.map +1 -1
  202. package/dist/testing/system.js +90 -107
  203. package/dist/testing/system.js.map +1 -1
  204. package/dist/tracing/http.d.ts +2 -1
  205. package/dist/tracing/http.d.ts.map +1 -1
  206. package/dist/tracing/http.js +2 -1
  207. package/dist/tracing/http.js.map +1 -1
  208. package/dist/tracing/node.d.ts.map +1 -1
  209. package/dist/tracing/node.js +1 -1
  210. package/dist/tracing/node.js.map +1 -1
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/frontends/mod.test.ts +6 -2
  213. package/frontends/mod.ts +20 -19
  214. package/gateway/errors.ts +30 -32
  215. package/gateway/match.ts +61 -57
  216. package/gateway/middleware.ts +62 -64
  217. package/gateway/mod.ts +73 -76
  218. package/gateway/request.ts +143 -140
  219. package/gateway/serve.ts +58 -63
  220. package/gateways/mod.ts +25 -23
  221. package/internal/otel/http.test.ts +50 -0
  222. package/internal/otel/http.ts +40 -5
  223. package/internal/runtime/napi/napi.cjs +6 -5
  224. package/internal/runtime/napi/napi.d.cts +58 -16
  225. package/internal/runtime/shutdown.ts +113 -101
  226. package/log/logger.test.ts +8 -0
  227. package/log/logger.ts +48 -45
  228. package/metrics/mod.ts +138 -122
  229. package/otel.ts +6 -3
  230. package/package.json +6 -1
  231. package/pubsub/subscription.ts +93 -123
  232. package/pubsub/topic.ts +96 -130
  233. package/redaction/bridge.test.ts +99 -0
  234. package/redaction/mod.test.ts +188 -0
  235. package/redaction/mod.ts +226 -0
  236. package/reqctx/mod.ts +83 -86
  237. package/services/index.ts +78 -78
  238. package/shutdown/mod.ts +26 -25
  239. package/storage/clickhouse/database.ts +115 -129
  240. package/storage/clickhouse/errors.ts +27 -29
  241. package/storage/clickhouse/mod.ts +10 -10
  242. package/storage/objects/bucket.test.ts +168 -16
  243. package/storage/objects/bucket.ts +336 -247
  244. package/storage/objects/error.ts +4 -4
  245. package/storage/objects/mod.ts +1 -0
  246. package/storage/objects/refs.ts +2 -5
  247. package/storage/postgres/database.ts +131 -164
  248. package/storage/postgres/errors.ts +45 -52
  249. package/storage/postgres/interval.ts +21 -21
  250. package/storage/redis/bitfield.ts +51 -26
  251. package/storage/redis/command.ts +16 -12
  252. package/storage/redis/commands.ts +99 -100
  253. package/storage/redis/database.ts +145 -123
  254. package/storage/redis/mod.ts +52 -48
  255. package/storage/redis/options.ts +26 -24
  256. package/storage/redis/pubsub.ts +14 -14
  257. package/storage/redis/redis.test.ts +17 -2
  258. package/storage/redis/reply.ts +85 -77
  259. package/storage/redis/scan.ts +6 -6
  260. package/storage/redis/script.ts +29 -22
  261. package/storage/redis/target.ts +34 -1
  262. package/storage/redis/wire.ts +8 -8
  263. package/testing/mod.ts +99 -105
  264. package/testing/playwright.ts +32 -37
  265. package/testing/puppeteer.ts +22 -23
  266. package/testing/system.ts +117 -133
  267. package/tracing/http.ts +2 -1
  268. package/tracing/native.test.ts +158 -8
  269. package/tracing/node.ts +1 -0
@@ -1,13 +1,11 @@
1
1
  import { StringLiteral } from '../internal/utils/constraints.js';
2
2
  /**
3
- * Secret represents a single secret value that is loaded
4
- * into the application. It is strongly typed for that secret,
5
- * so that you can write functions which expect a specific one.
3
+ * Represents a single secret loaded into the application. It is strongly typed
4
+ * to its secret name so functions can require a specific secret.
6
5
  *
7
- * You can use {@link AnySecret} to represent any secret without knowing
8
- * it's name.
6
+ * Use {@link AnySecret} to accept any secret regardless of its name.
9
7
  *
10
- * `T` is the type of the secret's value. Only `string` is supported.
8
+ * `T` is the secret's value type (only `string` is supported).
11
9
  *
12
10
  * @example
13
11
  *
@@ -19,11 +17,12 @@ export interface Secret<Name extends string, T extends string = string> {
19
17
  /**
20
18
  * Returns the value of the secret.
21
19
  *
22
- * The value is read once per process and does not change while it runs:
23
- * a new value reaches a service when it restarts.
20
+ * The value is loaded once per process and does not change while it is
21
+ * running; updated values take effect when the service restarts.
24
22
  *
25
- * Throws an `Error` naming the secret when it has no value, in every
26
- * environment, local development too.
23
+ * Locally (`encore run`, `encore test`), an unset secret returns `""` so
24
+ * checks like `if (!apiKey())` can skip unconfigured integrations. In all
25
+ * other environments, reading an unset secret throws an `Error` naming it.
27
26
  */
28
27
  (): T;
29
28
  /**
@@ -31,64 +30,61 @@ export interface Secret<Name extends string, T extends string = string> {
31
30
  */
32
31
  readonly name: Name;
33
32
  /**
34
- * Marks the type as an Encore secret, for Encore's parser, which reads a
35
- * config's type to know which of its fields read a secret. Never set.
33
+ * Type brand used by Encore's parser to detect secret fields inside a config
34
+ * type. Never set at runtime.
36
35
  *
37
- * As a field of a config's type, `apiKey: Secret<"StripeKey">` reads the
38
- * secret of that name in the config's own scope: the declaring service's
39
- * own for a service config, the app's for a shared or global one. The
40
- * secret is declared as any other is, with {@link secret}.
36
+ * When used in a config interface, `apiKey: Secret<"StripeKey">` references
37
+ * the secret with that name in the config's scope (the declaring service for
38
+ * a service config, or the app for a shared or global config). The secret
39
+ * itself must still be declared with {@link secret}.
41
40
  */
42
41
  readonly '~encore.secret'?: true;
43
42
  }
44
43
  /**
45
- * AnySecret is a type which can be used to represent any {@link Secret}
46
- * without knowing its name.
44
+ * Represents any {@link Secret} without requiring a specific name.
47
45
  */
48
46
  export type AnySecret = Secret<string>;
49
47
  /**
50
- * The options a secret is declared with. Read by Encore's parser, so the
51
- * values must be literals.
48
+ * Options for declaring a secret with {@link secret}. Values must be literals
49
+ * so Encore's parser can inspect them statically.
52
50
  */
53
51
  export interface SecretOptions {
54
52
  /**
55
- * Who the secret belongs to, written as a string literal for Encore to
56
- * read:
53
+ * Controls which services own and can read the secret. Must be a string
54
+ * literal so Encore can resolve it statically:
57
55
  *
58
- * - `"service"`, the default: the service that declares it. Two services
59
- * may each declare a secret of the same name and hold different values
60
- * in them, so adding a secret to one service can never collide with, or
61
- * silently reuse, a name another service already took. The declaration
62
- * must therefore live inside a service; Encore reports an error
63
- * otherwise.
64
- * - `"shared"`: the whole app, readable from any service, each that reads
65
- * it recorded as using it. It may be declared outside a service. Use it
66
- * only for a value several services genuinely share: a shared secret
67
- * couples every service that reads it, and widening a secret's scope
68
- * later is easier than narrowing it.
69
- * - `"global"`: the whole app, with one value available to every service
70
- * without being granted. It may be declared outside a service.
56
+ * - `"service"` (default): scoped to the declaring service. Two services may
57
+ * declare secrets with the same name and hold independent values, avoiding
58
+ * accidental collisions or silent reuse. Must be declared inside a
59
+ * service; Encore reports an error otherwise.
60
+ * - `"shared"`: app-wide and readable from any service, with each reading
61
+ * service recorded as a consumer. May be declared outside a service. Use
62
+ * this only when multiple services genuinely share a value — widening a
63
+ * secret's scope later is easier than narrowing it.
64
+ * - `"global"`: app-wide with a single value available to every service
65
+ * without requiring per-service grants. May be declared outside a service.
71
66
  */
72
67
  scope?: 'service' | 'shared' | 'global';
73
68
  /**
74
- * What the secret is, who issues it and how to rotate it, shown wherever its
75
- * values are managed. The declaration's doc comment wins when there is one.
69
+ * Human-readable description of the secret (what it is, who issues it, and
70
+ * how to rotate it), displayed wherever secret values are managed. A doc
71
+ * comment on the declaration takes precedence if both are present.
76
72
  */
77
73
  description?: string;
78
74
  /**
79
- * Tags that classify the secret, for policies to read: written out as
80
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
81
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
82
- * letter, and not with `encore`, which is reserved. At most 32 tags.
75
+ * Static string-literal tags that classify the secret for policy checks
76
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
77
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
78
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
83
79
  */
84
80
  tags?: Record<string, string>;
85
81
  }
86
82
  /**
87
- * secret declares a {@link Secret}, by default belonging to the service that
88
- * declares it. See {@link SecretOptions.scope} for a secret of the whole app.
83
+ * Declares a {@link Secret}, scoped by default to the declaring service. See
84
+ * {@link SecretOptions.scope} for app-wide secrets.
89
85
  *
90
- * A doc comment on the declaration, or a `description` option, is shown
91
- * wherever the secret's values are managed.
86
+ * A doc comment on the declaration (or the `description` option) is shown
87
+ * wherever secret values are managed.
92
88
  *
93
89
  * @example
94
90
  * ```ts
@@ -99,14 +95,14 @@ export interface SecretOptions {
99
95
  *
100
96
  * @example
101
97
  * ```ts
102
- * // A secret several services share.
98
+ * // A secret shared by several services.
103
99
  * import {secret} from "@encore.dev/sdk/config";
104
100
  * const signingKey = secret("SigningKey", {scope: "shared"});
105
101
  * ```
106
102
  *
107
103
  * @example
108
104
  * ```ts
109
- * // Documenting it.
105
+ * // Documenting a secret.
110
106
  * const apiKey = secret("ApiKey", {
111
107
  * description: "Issued by Acme Pay. Rotate it in their portal under Settings → API.",
112
108
  * });
@@ -114,9 +110,8 @@ export interface SecretOptions {
114
110
  */
115
111
  export declare function secret<Name extends string>(name: StringLiteral<Name>, opts?: SecretOptions): Secret<Name>;
116
112
  /**
117
- * The secret a config's secret field reads: what the runtime's placeholder
118
- * for the field stands for. A secret name has one scope across the app, so it
119
- * is read by name whatever the config's scope. Internal to the config module.
113
+ * Returns the secret handle referenced by a config's secret field placeholder.
114
+ * Internal to the config module.
120
115
  *
121
116
  * @internal
122
117
  */
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../config/secrets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAE5D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,MAAM,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACpE;;;;;;;;OAQG;IACH,IAAI,CAAC,CAAC;IAEN;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAEpB;;;;;;;;OAQG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;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CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,IAAI,SAAS,MAAM,EACxC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EAIzB,IAAI,CAAC,EAAE,aAAa,GACnB,MAAM,CAAC,IAAI,CAAC,CAEd;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAErD"}
@@ -1,11 +1,11 @@
1
1
  import * as runtime from '../internal/runtime/mod.js';
2
2
  import { lookupScope, testMode } from '../internal/testing/scope.js';
3
3
  /**
4
- * secret declares a {@link Secret}, by default belonging to the service that
5
- * declares it. See {@link SecretOptions.scope} for a secret of the whole app.
4
+ * Declares a {@link Secret}, scoped by default to the declaring service. See
5
+ * {@link SecretOptions.scope} for app-wide secrets.
6
6
  *
7
- * A doc comment on the declaration, or a `description` option, is shown
8
- * wherever the secret's values are managed.
7
+ * A doc comment on the declaration (or the `description` option) is shown
8
+ * wherever secret values are managed.
9
9
  *
10
10
  * @example
11
11
  * ```ts
@@ -16,14 +16,14 @@ import { lookupScope, testMode } from '../internal/testing/scope.js';
16
16
  *
17
17
  * @example
18
18
  * ```ts
19
- * // A secret several services share.
19
+ * // A secret shared by several services.
20
20
  * import {secret} from "@encore.dev/sdk/config";
21
21
  * const signingKey = secret("SigningKey", {scope: "shared"});
22
22
  * ```
23
23
  *
24
24
  * @example
25
25
  * ```ts
26
- * // Documenting it.
26
+ * // Documenting a secret.
27
27
  * const apiKey = secret("ApiKey", {
28
28
  * description: "Issued by Acme Pay. Rotate it in their portal under Settings → API.",
29
29
  * });
@@ -37,9 +37,8 @@ opts) {
37
37
  return makeSecret(name, runtime.RT.secret(name));
38
38
  }
39
39
  /**
40
- * The secret a config's secret field reads: what the runtime's placeholder
41
- * for the field stands for. A secret name has one scope across the app, so it
42
- * is read by name whatever the config's scope. Internal to the config module.
40
+ * Returns the secret handle referenced by a config's secret field placeholder.
41
+ * Internal to the config module.
43
42
  *
44
43
  * @internal
45
44
  */
@@ -57,6 +56,9 @@ function makeSecret(name, impl) {
57
56
  if (override != null)
58
57
  return override.toString('utf8');
59
58
  if (impl === null) {
59
+ // Unset locally: it reads as one set empty.
60
+ if (runtime.RT.unsetSecretsReadEmpty())
61
+ return '';
60
62
  throw new Error(`secret ${name} is not set`);
61
63
  }
62
64
  return impl.cached();
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../config/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AA8FhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,MAAM,CACpB,IAAyB;AACzB,sEAAsE;AACtE,8DAA8D;AAC9D,6DAA6D;AAC7D,IAAoB;IAEpB,OAAO,UAAU,CAAe,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,UAAU,CAAY,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU,CACjB,IAAY,EACZ,IAA0C;IAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,iDAAiD;QACjD,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtE,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB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AAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtE,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,4CAA4C;YAC5C,IAAI,OAAO,CAAC,EAAE,CAAC,qBAAqB,EAAE;gBAAE,OAAO,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,aAAa,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,SAAS,CAAC,QAAQ,GAAG,GAAG,EAAE;QACxB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,UAAU,IAAI,YAAY,CAAC;QACpC,CAAC;QACD,OAAO,UAAU,IAAI,cAAc,CAAC;IACtC,CAAC,CAAC;IACF,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IAExD,OAAO,SAAyB,CAAC;AACnC,CAAC"}
@@ -1,14 +1,14 @@
1
1
  /**
2
- * What a config's value is built from: the JSON the runtime hands over,
3
- * turned into what the declared type says, guided by the config's schema.
4
- * Durations become {@link Duration}s, and the runtime's placeholder for each
5
- * secret field becomes the secret itself. Kept apart from the runtime, so it
6
- * can be tested without one.
2
+ * Converts raw config JSON from the runtime into typed values using the
3
+ * config's JSON Schema: duration strings become {@link Duration} instances and
4
+ * secret placeholders become secret handles. Kept separate from the runtime so
5
+ * it can be unit-tested standalone.
7
6
  */
8
7
  /**
9
- * A length of time, written in config files as a number with a unit, or
10
- * several: `"30s"`, `"250ms"`, `"1h30m"` (units `ns`, `us`, `ms`, `s`, `m`,
11
- * `h`, as Go's `time.ParseDuration` reads them, without a sign).
8
+ * A non-negative length of time, written in config files as one or more
9
+ * number-and-unit pairs such as `"30s"`, `"250ms"`, or `"1h30m"`. Supported
10
+ * units are `ns`, `us`, `ms`, `s`, `m`, and `h` (matching Go's
11
+ * `time.ParseDuration`, without a leading sign).
12
12
  *
13
13
  * @example
14
14
  * interface Checkout { paymentTimeout: Duration }
@@ -16,38 +16,35 @@
16
16
  */
17
17
  export declare class Duration {
18
18
  /**
19
- * Marks the type as Encore's duration, for Encore's parser, which reads a
20
- * config's type to know what its files may hold. Never set.
19
+ * Type brand used by Encore's parser to identify duration fields in a config
20
+ * type. Never set at runtime.
21
21
  */
22
22
  readonly '~encore.duration'?: true;
23
23
  private readonly ms;
24
24
  private constructor();
25
- /** Reads a duration string; throws on anything else. */
25
+ /** Parses a duration string and throws if the format is invalid. */
26
26
  static parse(text: string): Duration;
27
- /** A duration of `ms` milliseconds. */
27
+ /** Creates a duration of `ms` milliseconds. */
28
28
  static ofMilliseconds(ms: number): Duration;
29
- /** The duration in milliseconds: what `setTimeout` takes. */
29
+ /** Returns the duration in milliseconds (suitable for `setTimeout`). */
30
30
  get milliseconds(): number;
31
- /** The duration in seconds. */
31
+ /** Returns the duration in seconds. */
32
32
  get seconds(): number;
33
- /** As a config file writes it: `"1h30m"`, `"250ms"`, `"0s"`. */
33
+ /** Formats the duration in config-file syntax (e.g. `"1h30m"`, `"250ms"`, `"0s"`). */
34
34
  toString(): string;
35
35
  toJSON(): string;
36
36
  }
37
37
  /**
38
- * The key of the runtime's placeholder for a secret field:
39
- * `{"$encore_secret": "<name>"}`. The name alone says which secret it is: a
40
- * secret's name has one scope across the app.
38
+ * Property key used in runtime secret placeholders (`{"$encore_secret": "<name>"}`).
41
39
  */
42
40
  export declare const PLACEHOLDER_KEY = "$encore_secret";
43
- /** Builds the secret a placeholder stands for, by its name. */
41
+ /** Resolves a secret placeholder's name into a secret handle. */
44
42
  export type SecretOf = (name: string) => unknown;
45
43
  type Schema = Record<string, any>;
46
44
  /**
47
- * `value`, as the declared type has it: the JSON the runtime hands over, with
48
- * each duration string `schema` marks made a {@link Duration}, and the
49
- * runtime's placeholder at each secret field `schema` marks made the secret
50
- * `secretOf` builds.
45
+ * Converts a raw JSON config `value` according to `schema`, turning duration
46
+ * strings into {@link Duration} instances and secret placeholders into handles
47
+ * via `secretOf`.
51
48
  */
52
49
  export declare function build(schema: Schema, value: unknown, secretOf: SecretOf): unknown;
53
50
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../config/value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH;;;;;;;;GAQG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,SAAiB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAE5B,OAAO;IAIP,wDAAwD;IACxD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAgBpC,uCAAuC;IACvC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ;IAO3C,6DAA6D;IAC7D,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,+BAA+B;IAC/B,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,gEAAgE;IAChE,QAAQ,IAAI,MAAM;IAsBlB,MAAM,IAAI,MAAM;CAGjB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAEjD,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAET"}
1
+ {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../config/value.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,SAAiB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAE5B,OAAO;IAIP,oEAAoE;IACpE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAgBpC,+CAA+C;IAC/C,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ;IAO3C,wEAAwE;IACxE,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,uCAAuC;IACvC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,sFAAsF;IACtF,QAAQ,IAAI,MAAM;IAsBlB,MAAM,IAAI,MAAM;CAGjB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,iEAAiE;AACjE,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAEjD,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElC;;;;GAIG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAET"}
@@ -1,11 +1,10 @@
1
1
  /**
2
- * What a config's value is built from: the JSON the runtime hands over,
3
- * turned into what the declared type says, guided by the config's schema.
4
- * Durations become {@link Duration}s, and the runtime's placeholder for each
5
- * secret field becomes the secret itself. Kept apart from the runtime, so it
6
- * can be tested without one.
2
+ * Converts raw config JSON from the runtime into typed values using the
3
+ * config's JSON Schema: duration strings become {@link Duration} instances and
4
+ * secret placeholders become secret handles. Kept separate from the runtime so
5
+ * it can be unit-tested standalone.
7
6
  */
8
- /** What a duration string looks like: one or more numbers, each with a unit. */
7
+ /** Matches a non-negative duration string (one or more number+unit segments). */
9
8
  const DURATION = /^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$/;
10
9
  const UNIT_MS = {
11
10
  ns: 1e-6,
@@ -17,9 +16,10 @@ const UNIT_MS = {
17
16
  h: 3600000,
18
17
  };
19
18
  /**
20
- * A length of time, written in config files as a number with a unit, or
21
- * several: `"30s"`, `"250ms"`, `"1h30m"` (units `ns`, `us`, `ms`, `s`, `m`,
22
- * `h`, as Go's `time.ParseDuration` reads them, without a sign).
19
+ * A non-negative length of time, written in config files as one or more
20
+ * number-and-unit pairs such as `"30s"`, `"250ms"`, or `"1h30m"`. Supported
21
+ * units are `ns`, `us`, `ms`, `s`, `m`, and `h` (matching Go's
22
+ * `time.ParseDuration`, without a leading sign).
23
23
  *
24
24
  * @example
25
25
  * interface Checkout { paymentTimeout: Duration }
@@ -30,10 +30,10 @@ export class Duration {
30
30
  constructor(ms) {
31
31
  this.ms = ms;
32
32
  }
33
- /** Reads a duration string; throws on anything else. */
33
+ /** Parses a duration string and throws if the format is invalid. */
34
34
  static parse(text) {
35
35
  if (!DURATION.test(text)) {
36
- throw new Error(`${JSON.stringify(text)} is not a duration, such as "30s", "250ms" or "1h30m"`);
36
+ throw new Error(`${JSON.stringify(text)} is not a valid duration (expected e.g. "30s", "250ms", or "1h30m")`);
37
37
  }
38
38
  let ms = 0;
39
39
  for (const m of text.matchAll(/([0-9]+(?:\.[0-9]+)?)(ns|us|µs|ms|s|m|h)/g)) {
@@ -42,22 +42,22 @@ export class Duration {
42
42
  // Whole nanoseconds, so that "0.1s" is 100ms rather than 100.00000000000001.
43
43
  return new Duration(Math.round(ms * 1e6) / 1e6);
44
44
  }
45
- /** A duration of `ms` milliseconds. */
45
+ /** Creates a duration of `ms` milliseconds. */
46
46
  static ofMilliseconds(ms) {
47
47
  if (!(ms >= 0)) {
48
- throw new Error('a duration is not negative');
48
+ throw new Error('duration must not be negative');
49
49
  }
50
50
  return new Duration(ms);
51
51
  }
52
- /** The duration in milliseconds: what `setTimeout` takes. */
52
+ /** Returns the duration in milliseconds (suitable for `setTimeout`). */
53
53
  get milliseconds() {
54
54
  return this.ms;
55
55
  }
56
- /** The duration in seconds. */
56
+ /** Returns the duration in seconds. */
57
57
  get seconds() {
58
58
  return this.ms / 1000;
59
59
  }
60
- /** As a config file writes it: `"1h30m"`, `"250ms"`, `"0s"`. */
60
+ /** Formats the duration in config-file syntax (e.g. `"1h30m"`, `"250ms"`, `"0s"`). */
61
61
  toString() {
62
62
  let ms = this.ms;
63
63
  if (ms === 0)
@@ -85,16 +85,13 @@ export class Duration {
85
85
  }
86
86
  }
87
87
  /**
88
- * The key of the runtime's placeholder for a secret field:
89
- * `{"$encore_secret": "<name>"}`. The name alone says which secret it is: a
90
- * secret's name has one scope across the app.
88
+ * Property key used in runtime secret placeholders (`{"$encore_secret": "<name>"}`).
91
89
  */
92
90
  export const PLACEHOLDER_KEY = '$encore_secret';
93
91
  /**
94
- * `value`, as the declared type has it: the JSON the runtime hands over, with
95
- * each duration string `schema` marks made a {@link Duration}, and the
96
- * runtime's placeholder at each secret field `schema` marks made the secret
97
- * `secretOf` builds.
92
+ * Converts a raw JSON config `value` according to `schema`, turning duration
93
+ * strings into {@link Duration} instances and secret placeholders into handles
94
+ * via `secretOf`.
98
95
  */
99
96
  export function build(schema, value, secretOf) {
100
97
  return convert(schema, schema, value, secretOf, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"value.js","sourceRoot":"","sources":["../../config/value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gFAAgF;AAChF,MAAM,QAAQ,GAAG,2CAA2C,CAAC;AAC7D,MAAM,OAAO,GAA2B;IACtC,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,CAAC;IACL,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,KAAM;IACT,CAAC,EAAE,OAAS;CACb,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,OAAO,QAAQ;IAOF,EAAE,CAAS;IAE5B,YAAoB,EAAU;QAC5B,IAAI,CAAC,E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Q,EAAE,CAAC;YACzB,MAAM,KAAK,GAAG,CAAC,EAAE,UAAU,CAAC;YAC5B,IAAI,CAAC,KAAK;gBAAE,SAAS;YACrB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CACxC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAgB,EAAE,EAAE,CACxB,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtB,KAAiC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CACpD,CAAC;YACF,IACE,MAAM;gBACN,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAC3D,CAAC;gBACD,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrE,OAAO,KAAK,CAAC;IACf,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC;AAC1D,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { DurationString } from '../types/mod.js';
2
2
  /**
3
- * The header with a run's idempotency key: an id that is the same each time
4
- * Encore sends the run, as when it sends it again after a failure. A job
5
- * that must not do its work twice can check whether it has seen the key
6
- * before:
3
+ * Header containing a cron run's idempotency key. The value stays the same
4
+ * across retries of the same execution, so a job that must not run its side
5
+ * effects twice can deduplicate using this key:
7
6
  *
8
7
  * ```ts
9
8
  * app.post('/internal/cleanup', (req, res) => {
@@ -12,46 +11,61 @@ import { DurationString } from '../types/mod.js';
12
11
  * });
13
12
  * ```
14
13
  *
15
- * Only Encore sends it: a gateway removes it from the requests it takes from
16
- * clients. `encore cron trigger <name>` runs a job locally, as Encore runs it
17
- * when it is due.
14
+ * Only Encore sets this header; gateways strip it from external client
15
+ * requests. Run `encore cron trigger <name>` to execute a job immediately
16
+ * during local development. Jobs declared with `runIn: {local: true}` also run
17
+ * on schedule while a local session is active.
18
18
  */
19
19
  export declare const IDEMPOTENCY_KEY_HEADER = "x-encore-cron-execution";
20
20
  /**
21
- * The header that says why a job runs: `scheduled`, when it was due, or
22
- * `manual`, when someone asked for it to run now.
21
+ * Header indicating what triggered a cron run: `"scheduled"` when the job ran
22
+ * on its schedule, or `"manual"` when triggered manually.
23
23
  */
24
24
  export declare const TRIGGER_HEADER = "x-encore-cron-trigger";
25
25
  export declare class CronJob {
26
26
  readonly name: string;
27
27
  /**
28
- * What the job was declared with. Read-only: Encore schedules the job from
29
- * the declaration in the source, so a changed path would not be requested.
28
+ * The cron job configuration as declared in source code. Read-only because
29
+ * Encore reads the schedule and target path statically from the declaration.
30
30
  */
31
31
  readonly cfg: Readonly<CronJobConfig>;
32
32
  constructor(name: string, cfg: CronJobConfig);
33
33
  }
34
34
  /**
35
- * The configuration of a cron job: the path it requests and when.
35
+ * Configuration for a cron job: the endpoint path to call and its schedule.
36
36
  *
37
- * When the job is due, Encore sends a `POST` request for `path` to the service
38
- * that declares the job. The fields must be literals: Encore reads them from
39
- * the source.
37
+ * When the job is due, Encore sends a `POST` request to `path` on the service
38
+ * that declares the job. All configuration fields must be string/boolean
39
+ * literals because Encore parses them statically from source code.
40
40
  */
41
41
  export type CronJobConfig = {
42
- /** The path the job requests of its service, starting with `/`. */
42
+ /** The endpoint path on the declaring service to `POST` to, starting with `/`. */
43
43
  path: string;
44
44
  title?: string;
45
45
  /**
46
- * Tags that classify the cron job, for policies to read: written out as
47
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
48
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
49
- * letter, and not with `encore`, which is reserved. At most 32 tags.
46
+ * Classification tags for policies, written as string literals (for example,
47
+ * `{data: "pci"}`). Keys and values may contain lowercase letters, digits,
48
+ * `_`, and `-`, up to 63 characters. Keys must start with a letter and cannot
49
+ * start with `encore` (which is reserved). At most 32 tags are allowed.
50
50
  */
51
51
  tags?: Record<string, string>;
52
+ /** Controls which environment types run this job on schedule. */
53
+ runIn?: CronJobRunIn;
52
54
  } & ({
53
55
  every: DurationString;
54
56
  } | {
55
57
  schedule: string;
56
58
  });
59
+ /**
60
+ * Controls which environment types run a cron job on schedule. Cron jobs always
61
+ * run in deployed environments; locally they only run when `local` is `true`.
62
+ */
63
+ export type CronJobRunIn = {
64
+ /**
65
+ * Whether the job also runs on schedule during local development (for example
66
+ * while `encore run` is active). Defaults to `false`, and developers can
67
+ * override it per local checkout.
68
+ */
69
+ local?: boolean;
70
+ };
57
71
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD,qBAAa,OAAO;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;gBAC1B,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;CAO7C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GAAG,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAC,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD,qBAAa,OAAO;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;gBAC1B,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;CAO7C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,iEAAiE;IACjE,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,GAAG,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAC,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC"}
package/dist/cron/mod.js CHANGED
@@ -1,8 +1,7 @@
1
1
  /**
2
- * The header with a run's idempotency key: an id that is the same each time
3
- * Encore sends the run, as when it sends it again after a failure. A job
4
- * that must not do its work twice can check whether it has seen the key
5
- * before:
2
+ * Header containing a cron run's idempotency key. The value stays the same
3
+ * across retries of the same execution, so a job that must not run its side
4
+ * effects twice can deduplicate using this key:
6
5
  *
7
6
  * ```ts
8
7
  * app.post('/internal/cleanup', (req, res) => {
@@ -11,27 +10,28 @@
11
10
  * });
12
11
  * ```
13
12
  *
14
- * Only Encore sends it: a gateway removes it from the requests it takes from
15
- * clients. `encore cron trigger <name>` runs a job locally, as Encore runs it
16
- * when it is due.
13
+ * Only Encore sets this header; gateways strip it from external client
14
+ * requests. Run `encore cron trigger <name>` to execute a job immediately
15
+ * during local development. Jobs declared with `runIn: {local: true}` also run
16
+ * on schedule while a local session is active.
17
17
  */
18
18
  export const IDEMPOTENCY_KEY_HEADER = 'x-encore-cron-execution';
19
19
  /**
20
- * The header that says why a job runs: `scheduled`, when it was due, or
21
- * `manual`, when someone asked for it to run now.
20
+ * Header indicating what triggered a cron run: `"scheduled"` when the job ran
21
+ * on its schedule, or `"manual"` when triggered manually.
22
22
  */
23
23
  export const TRIGGER_HEADER = 'x-encore-cron-trigger';
24
24
  export class CronJob {
25
25
  name;
26
26
  /**
27
- * What the job was declared with. Read-only: Encore schedules the job from
28
- * the declaration in the source, so a changed path would not be requested.
27
+ * The cron job configuration as declared in source code. Read-only because
28
+ * Encore reads the schedule and target path statically from the declaration.
29
29
  */
30
30
  cfg;
31
31
  constructor(name, cfg) {
32
32
  this.name = name;
33
- // Frozen as well as typed `readonly`, so a write throws in an app that
34
- // runs without `tsc` checking it.
33
+ // Frozen at runtime as well as typed `readonly`, so mutations throw even
34
+ // when running without TypeScript type checking.
35
35
  this.cfg = Object.freeze({ ...cfg });
36
36
  Object.freeze(this);
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAEtD,MAAM,OAAO,OAAO;IACT,IAAI,CAAS;IACtB;;;OAGG;IACM,GAAG,CAA0B;IACtC,YAAY,IAAY,EAAE,GAAkB;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,uEAAuE;QACvE,kCAAkC;QAClC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAC,GAAG,GAAG,EAAC,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF"}
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAEtD,MAAM,OAAO,OAAO;IACT,IAAI,CAAS;IACtB;;;OAGG;IACM,GAAG,CAA0B;IACtC,YAAY,IAAY,EAAE,GAAkB;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAC,GAAG,GAAG,EAAC,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF"}