@plitzi/sdk-shared 0.35.3 → 0.35.5

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.
@@ -169,8 +169,8 @@ declare const styleConstants: {
169
169
  };
170
170
  export declare const inheritableAttributesBase: StyleCategory[];
171
171
  export declare const StyleBindingsAllowed: {
172
- path: "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "cursor" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "color" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
173
- label: "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "cursor" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "color" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
172
+ path: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
173
+ label: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
174
174
  }[];
175
175
  export declare const baseDefaultValue: Record<StyleCategory, StyleValue>;
176
176
  export default styleConstants;
@@ -1,5 +1,6 @@
1
1
  import { Environment } from './CommonTypes';
2
2
  import { ElementInteraction } from './SchemaTypes';
3
+ import { SmtpSettings } from '../actions/smtp';
3
4
  /**
4
5
  * What an action's inputs and outputs may be.
5
6
  *
@@ -313,6 +314,57 @@ export type ActionRunRecord = {
313
314
  /** Present when the run ended badly. Already redacted of credential values. */
314
315
  error?: string;
315
316
  };
317
+ /**
318
+ * One message a flow asked to send.
319
+ *
320
+ * Plain text only. The body is whatever a flow rendered, and a flow renders what a visitor typed: HTML built from
321
+ * that is markup a stranger wrote, sent from the space's own domain.
322
+ */
323
+ export type ActionEmailMessage = {
324
+ to: string;
325
+ subject: string;
326
+ text: string;
327
+ replyTo?: string;
328
+ };
329
+ /** One message on its way out, as a deployment's own transport receives it. */
330
+ export type ActionEmailDelivery = {
331
+ /** The space the run belongs to, for a transport that routes or attributes mail per space. */
332
+ spaceId: number;
333
+ /** The SMTP credential the step named, already judged by `readSmtpCredential`. */
334
+ smtp: SmtpSettings;
335
+ message: ActionEmailMessage;
336
+ /** Aborted when the run is. The run ends either way; a transport that ignores it may still let the message leave. */
337
+ signal: AbortSignal;
338
+ };
339
+ /**
340
+ * How a message leaves, when the deployment decides that rather than `sdk-server`.
341
+ *
342
+ * Without one the server opens an SMTP connection to the credential's host itself — resolved, judged against private
343
+ * networks, connected by address. A deployment that routes mail its own way — a relay pool, a provider's API, a capture
344
+ * in tests — supplies this and owns that connection, and with it the network rule. What stays the server's: the step's
345
+ * checks on the message, the credential being judged, and the daily limit counted before this is called. Throwing
346
+ * fails the step with that message.
347
+ */
348
+ export type ActionEmailTransport = (delivery: ActionEmailDelivery) => Promise<void>;
349
+ /**
350
+ * What a deployment decides about the mail its spaces' flows send through their own SMTP credentials.
351
+ *
352
+ * The server is still the one sending, from the deployment's addresses — so how much one space may send, whether a
353
+ * credential may point inside the deployment's own network, and how a message leaves are the deployment's to say.
354
+ */
355
+ export type ActionEmailConfig = {
356
+ /** Messages one space may send per UTC day, counted before each send. Default 200. */
357
+ dailyLimitPerSpace?: number;
358
+ /**
359
+ * Lets an SMTP credential name a host on a private network — `localhost`, `10.x`, `192.168.x`. Off by default:
360
+ * a hosted server refuses them, because a credential is typed by a customer and the connection starts inside the
361
+ * cluster. On for a development mail catcher, or a self-hosted server whose relay lives beside it. Only consulted
362
+ * when the server opens the connection itself, which is when there is no `transport`.
363
+ */
364
+ allowPrivateHosts?: boolean;
365
+ /** Replaces the server's own SMTP connection. See {@link ActionEmailTransport}. */
366
+ transport?: ActionEmailTransport;
367
+ };
316
368
  /**
317
369
  * One thing a CHECK found about an action, before anybody runs it.
318
370
  *
@@ -1,4 +1,5 @@
1
1
  import { ElementInteraction } from './SchemaTypes';
2
+ import { SpaceCredentialProvider } from './SpaceTypes';
2
3
  import { RuleValue } from '@plitzi/plitzi-ui/QueryBuilder';
3
4
  export type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
4
5
  export type InteractionStatus = 'completed' | 'skipped' | 'failed';
@@ -24,6 +25,11 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
24
25
  canBind?: boolean;
25
26
  label?: string;
26
27
  when?: boolean | ((params: InteractionCallbackParamValues<T>) => boolean);
28
+ /**
29
+ * This param names one of the space's credentials, of this provider. Serializable on purpose: an editor offers the
30
+ * space's credentials of that kind to pick from, rather than a text box somebody has to type an identifier into.
31
+ */
32
+ credentialProvider?: SpaceCredentialProvider;
27
33
  } & ({
28
34
  type: 'text';
29
35
  defaultValue?: string | number;
@@ -1,4 +1,4 @@
1
- import { ActionEntry, ActionLimits, ActionRejectReason, ActionRejectRecord, ActionRunRecord, ActionRunStatus, ActionTaskDescriptor, ActionTriggerType } from './ActionTypes';
1
+ import { ActionEmailConfig, ActionEntry, ActionLimits, ActionRejectReason, ActionRejectRecord, ActionRunRecord, ActionRunStatus, ActionTaskDescriptor, ActionTriggerType } from './ActionTypes';
2
2
  import { Environment } from './CommonTypes';
3
3
  import { ConnectorEntry } from './ConnectorTypes';
4
4
  import { Schema } from './SchemaTypes';
@@ -504,6 +504,12 @@ export type SSRActionConfig = {
504
504
  * SPACE declared as a credential — never this deployment's own, which no credential a space holds can name.
505
505
  */
506
506
  dbDrivers?: unknown[];
507
+ /**
508
+ * The limits on `email.send`, which sends through the SMTP credential a step names, and optionally how a message
509
+ * leaves. Omitted keeps the defaults: 200 messages per space per day, no SMTP host on a private network, and the
510
+ * server's own SMTP connection. See {@link ActionEmailConfig}.
511
+ */
512
+ email?: ActionEmailConfig;
507
513
  /**
508
514
  * Called once per run that STARTED — completed, failed or aborted — for a deployment that keeps a record.
509
515
  * Shaped as `ActionRunRecord` in `@plitzi/sdk-server/actions`.
@@ -1,7 +1,7 @@
1
1
  import { ActionDocument } from './ActionTypes';
2
2
  import { Environment } from './CommonTypes';
3
3
  import { ConnectorManifestDraft } from './ConnectorTypes';
4
- export type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom';
4
+ export type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp';
5
5
  /**
6
6
  * A connector manifest as the builder sees it.
7
7
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-shared",
3
- "version": "0.35.3",
3
+ "version": "0.35.5",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -26,6 +26,10 @@
26
26
  "types": "./dist/actions/index.d.ts",
27
27
  "import": "./dist/actions/index.mjs"
28
28
  },
29
+ "./actions/smtp": {
30
+ "types": "./dist/actions/smtp.d.ts",
31
+ "import": "./dist/actions/smtp.mjs"
32
+ },
29
33
  "./actions/triggerParams": {
30
34
  "types": "./dist/actions/triggerParams.d.ts",
31
35
  "import": "./dist/actions/triggerParams.mjs"