@encore.dev/sdk 2.0.0-beta.15 → 2.0.0-beta.17

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 (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -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,13 +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
- * Locally (`encore run`, `encore test`), a secret with no value reads as
26
- * `""`, like one set empty: a secret lacks a value there until it is set.
27
- * So `if (!apiKey())` skips an integration that isn't configured yet.
28
- * Anywhere else it throws an `Error` naming the secret.
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.
29
26
  */
30
27
  (): T;
31
28
  /**
@@ -33,64 +30,61 @@ export interface Secret<Name extends string, T extends string = string> {
33
30
  */
34
31
  readonly name: Name;
35
32
  /**
36
- * Marks the type as an Encore secret, for Encore's parser, which reads a
37
- * 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.
38
35
  *
39
- * As a field of a config's type, `apiKey: Secret<"StripeKey">` reads the
40
- * secret of that name in the config's own scope: the declaring service's
41
- * own for a service config, the app's for a shared or global one. The
42
- * 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}.
43
40
  */
44
41
  readonly '~encore.secret'?: true;
45
42
  }
46
43
  /**
47
- * AnySecret is a type which can be used to represent any {@link Secret}
48
- * without knowing its name.
44
+ * Represents any {@link Secret} without requiring a specific name.
49
45
  */
50
46
  export type AnySecret = Secret<string>;
51
47
  /**
52
- * The options a secret is declared with. Read by Encore's parser, so the
53
- * 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.
54
50
  */
55
51
  export interface SecretOptions {
56
52
  /**
57
- * Who the secret belongs to, written as a string literal for Encore to
58
- * read:
53
+ * Controls which services own and can read the secret. Must be a string
54
+ * literal so Encore can resolve it statically:
59
55
  *
60
- * - `"service"`, the default: the service that declares it. Two services
61
- * may each declare a secret of the same name and hold different values
62
- * in them, so adding a secret to one service can never collide with, or
63
- * silently reuse, a name another service already took. The declaration
64
- * must therefore live inside a service; Encore reports an error
65
- * otherwise.
66
- * - `"shared"`: the whole app, readable from any service, each that reads
67
- * it recorded as using it. It may be declared outside a service. Use it
68
- * only for a value several services genuinely share: a shared secret
69
- * couples every service that reads it, and widening a secret's scope
70
- * later is easier than narrowing it.
71
- * - `"global"`: the whole app, with one value available to every service
72
- * 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.
73
66
  */
74
67
  scope?: 'service' | 'shared' | 'global';
75
68
  /**
76
- * What the secret is, who issues it and how to rotate it, shown wherever its
77
- * 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.
78
72
  */
79
73
  description?: string;
80
74
  /**
81
- * Tags that classify the secret, for policies to read: written out as
82
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
83
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
84
- * 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.
85
79
  */
86
80
  tags?: Record<string, string>;
87
81
  }
88
82
  /**
89
- * secret declares a {@link Secret}, by default belonging to the service that
90
- * 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.
91
85
  *
92
- * A doc comment on the declaration, or a `description` option, is shown
93
- * 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.
94
88
  *
95
89
  * @example
96
90
  * ```ts
@@ -101,14 +95,14 @@ export interface SecretOptions {
101
95
  *
102
96
  * @example
103
97
  * ```ts
104
- * // A secret several services share.
98
+ * // A secret shared by several services.
105
99
  * import {secret} from "@encore.dev/sdk/config";
106
100
  * const signingKey = secret("SigningKey", {scope: "shared"});
107
101
  * ```
108
102
  *
109
103
  * @example
110
104
  * ```ts
111
- * // Documenting it.
105
+ * // Documenting a secret.
112
106
  * const apiKey = secret("ApiKey", {
113
107
  * description: "Issued by Acme Pay. Rotate it in their portal under Settings → API.",
114
108
  * });
@@ -116,9 +110,8 @@ export interface SecretOptions {
116
110
  */
117
111
  export declare function secret<Name extends string>(name: StringLiteral<Name>, opts?: SecretOptions): Secret<Name>;
118
112
  /**
119
- * The secret a config's secret field reads: what the runtime's placeholder
120
- * for the field stands for. A secret name has one scope across the app, so it
121
- * 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.
122
115
  *
123
116
  * @internal
124
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,I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,CAAC,EAAE,IAAI,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAExC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,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
  */
@@ -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;AAgGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAA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M,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,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,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od.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,45 +11,45 @@ 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 now, as Encore runs
17
- * it when it is due; one declared with `runIn: {local: true}` also runs on
18
- * schedule while the app has a session open.
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.
19
18
  */
20
19
  export declare const IDEMPOTENCY_KEY_HEADER = "x-encore-cron-execution";
21
20
  /**
22
- * The header that says why a job runs: `scheduled`, when it was due, or
23
- * `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.
24
23
  */
25
24
  export declare const TRIGGER_HEADER = "x-encore-cron-trigger";
26
25
  export declare class CronJob {
27
26
  readonly name: string;
28
27
  /**
29
- * What the job was declared with. Read-only: Encore schedules the job from
30
- * 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.
31
30
  */
32
31
  readonly cfg: Readonly<CronJobConfig>;
33
32
  constructor(name: string, cfg: CronJobConfig);
34
33
  }
35
34
  /**
36
- * 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.
37
36
  *
38
- * When the job is due, Encore sends a `POST` request for `path` to the service
39
- * that declares the job. The fields must be literals: Encore reads them from
40
- * 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.
41
40
  */
42
41
  export type CronJobConfig = {
43
- /** The path the job requests of its service, starting with `/`. */
42
+ /** The endpoint path on the declaring service to `POST` to, starting with `/`. */
44
43
  path: string;
45
44
  title?: string;
46
45
  /**
47
- * Tags that classify the cron job, for policies to read: written out as
48
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
49
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
50
- * 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.
51
50
  */
52
51
  tags?: Record<string, string>;
53
- /** The kinds of environment the job is scheduled in. */
52
+ /** Controls which environment types run this job on schedule. */
54
53
  runIn?: CronJobRunIn;
55
54
  } & ({
56
55
  every: DurationString;
@@ -58,14 +57,14 @@ export type CronJobConfig = {
58
57
  schedule: string;
59
58
  });
60
59
  /**
61
- * The kinds of environment a cron job is scheduled in. Wherever the app is
62
- * deployed, it is; locally only when `local` says so.
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`.
63
62
  */
64
63
  export type CronJobRunIn = {
65
64
  /**
66
- * Whether the job is scheduled on a developer's machine too, while the
67
- * app has a session open there (as `encore run` keeps one). False unless
68
- * set; a developer can override it for their checkout either way.
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.
69
68
  */
70
69
  local?: boolean;
71
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5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O7C;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,28 +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 now, as Encore runs
16
- * it when it is due; one declared with `runIn: {local: true}` also runs on
17
- * schedule while the app has a session open.
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.
18
17
  */
19
18
  export const IDEMPOTENCY_KEY_HEADER = 'x-encore-cron-execution';
20
19
  /**
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.
20
+ * Header indicating what triggered a cron run: `"scheduled"` when the job ran
21
+ * on its schedule, or `"manual"` when triggered manually.
23
22
  */
24
23
  export const TRIGGER_HEADER = 'x-encore-cron-trigger';
25
24
  export class CronJob {
26
25
  name;
27
26
  /**
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.
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.
30
29
  */
31
30
  cfg;
32
31
  constructor(name, cfg) {
33
32
  this.name = name;
34
- // Frozen as well as typed `readonly`, so a write throws in an app that
35
- // 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.
36
35
  this.cfg = Object.freeze({ ...cfg });
37
36
  Object.freeze(this);
38
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../cron/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;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"}