@cosmicdrift/kumiko-types 0.358.0 → 0.360.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +1 -0
- package/dist/fields.d.ts +3 -0
- package/dist/fields.js +1 -6
- package/dist/screen.d.ts +3 -0
- package/dist/session-cookies.d.ts +20 -0
- package/dist/session-cookies.js +31 -0
- package/package.json +9 -1
package/dist/config.d.ts
CHANGED
package/dist/fields.d.ts
CHANGED
|
@@ -641,6 +641,9 @@ export type ImagesFieldDef = {
|
|
|
641
641
|
readonly accept?: readonly string[];
|
|
642
642
|
readonly maxCount?: number;
|
|
643
643
|
readonly variants?: Readonly<Record<string, VariantSpec>>;
|
|
644
|
+
/** Forwarded to the file input's `capture` attribute so a phone opens the
|
|
645
|
+
* camera instead of the file picker. */
|
|
646
|
+
readonly capture?: "environment" | "user";
|
|
644
647
|
readonly access?: FieldAccess;
|
|
645
648
|
} & ResolvedPiiFlags;
|
|
646
649
|
export type FieldDefinition = TextFieldDef | LongTextFieldDef | BooleanFieldDef | SelectFieldDef | MultiSelectFieldDef | NumberFieldDef | BigIntFieldDef | DecimalFieldDef | MoneyFieldDef | ReferenceFieldDef | EmbeddedFieldDef | JsonbFieldDef | DateFieldDef | TimestampFieldDef | TzFieldDef | LocatedTimestampFieldDef | FileFieldDef | ImageFieldDef | FilesFieldDef | ImagesFieldDef;
|
package/dist/fields.js
CHANGED
|
@@ -52,9 +52,4 @@ export const FIELD_TYPE_NAMES = Object.keys(FIELD_TYPE_NAME_FLAGS);
|
|
|
52
52
|
// A plain array, not a Set: kumiko-types stays free of module-scope runtime
|
|
53
53
|
// identity (guard-types-class-free.test.ts) since a consumer may resolve two
|
|
54
54
|
// copies of this package.
|
|
55
|
-
export const NO_WIDGET_FIELD_TYPES = [
|
|
56
|
-
"jsonb",
|
|
57
|
-
"embedded",
|
|
58
|
-
"files",
|
|
59
|
-
"images",
|
|
60
|
-
];
|
|
55
|
+
export const NO_WIDGET_FIELD_TYPES = ["jsonb", "embedded"];
|
package/dist/screen.d.ts
CHANGED
|
@@ -1340,6 +1340,9 @@ export type ActionFormScreenDefinition = {
|
|
|
1340
1340
|
readonly fallback?: string;
|
|
1341
1341
|
/** Derived by buildAppSchema — see EntityEditScreenDefinition.urlPrefillFields. */
|
|
1342
1342
|
readonly urlPrefillFields?: readonly string[];
|
|
1343
|
+
/** Derived by buildAppSchema from the `excludedFields` of the called `handler`; the form
|
|
1344
|
+
* shows these fields read-only, not required and never in the payload. An authored value is overwritten. */
|
|
1345
|
+
readonly writeExcludedFields?: readonly string[];
|
|
1343
1346
|
/** Submit is enabled without edits: values seeded from navigate `params` count as the
|
|
1344
1347
|
* user's intent. Every required field the layout hides with `visible: false` must hold a
|
|
1345
1348
|
* value, otherwise submit stays disabled (boot-checked against navigate `params`). */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const AUTH_COOKIE_BASE = "kumiko_auth";
|
|
2
|
+
export declare const CSRF_COOKIE_BASE = "kumiko_csrf";
|
|
3
|
+
export declare const TENANT_COOKIE_BASE = "kumiko_tenant";
|
|
4
|
+
export declare const HOST_COOKIE_PREFIX = "__Host-";
|
|
5
|
+
export type SessionCookieBase = typeof AUTH_COOKIE_BASE | typeof CSRF_COOKIE_BASE | typeof TENANT_COOKIE_BASE;
|
|
6
|
+
export type SessionCookieNames = {
|
|
7
|
+
readonly auth: string;
|
|
8
|
+
readonly csrf: string;
|
|
9
|
+
readonly tenant: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function sessionCookieName(base: SessionCookieBase, options: {
|
|
12
|
+
readonly secure: boolean;
|
|
13
|
+
readonly domain?: string | undefined;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function isHostPrefixedCookieName(name: string): boolean;
|
|
16
|
+
export declare function resolveSessionCookieNames(options: {
|
|
17
|
+
readonly secure: boolean;
|
|
18
|
+
readonly domain?: string | undefined;
|
|
19
|
+
}): SessionCookieNames;
|
|
20
|
+
export declare function sessionCookieNameCandidates(base: SessionCookieBase): readonly string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Single source of the session cookie names, shared by the server and by
|
|
2
|
+
// browser/native clients (this package has no server dependencies).
|
|
3
|
+
//
|
|
4
|
+
// A cookie gets the `__Host-` prefix exactly when it is written Secure and
|
|
5
|
+
// without a Domain attribute: the browser then refuses any Set-Cookie for that
|
|
6
|
+
// name that is not Secure, Path=/ and host-only, so a sibling subdomain cannot
|
|
7
|
+
// set or shadow it.
|
|
8
|
+
export const AUTH_COOKIE_BASE = "kumiko_auth";
|
|
9
|
+
export const CSRF_COOKIE_BASE = "kumiko_csrf";
|
|
10
|
+
export const TENANT_COOKIE_BASE = "kumiko_tenant";
|
|
11
|
+
export const HOST_COOKIE_PREFIX = "__Host-";
|
|
12
|
+
export function sessionCookieName(base, options) {
|
|
13
|
+
return options.secure && options.domain === undefined ? `${HOST_COOKIE_PREFIX}${base}` : base;
|
|
14
|
+
}
|
|
15
|
+
export function isHostPrefixedCookieName(name) {
|
|
16
|
+
return name.startsWith(HOST_COOKIE_PREFIX);
|
|
17
|
+
}
|
|
18
|
+
// The tenant cookie is always host-only, so a cookieDomain only affects the
|
|
19
|
+
// auth and csrf names.
|
|
20
|
+
export function resolveSessionCookieNames(options) {
|
|
21
|
+
return {
|
|
22
|
+
auth: sessionCookieName(AUTH_COOKIE_BASE, options),
|
|
23
|
+
csrf: sessionCookieName(CSRF_COOKIE_BASE, options),
|
|
24
|
+
tenant: sessionCookieName(TENANT_COOKIE_BASE, { secure: options.secure }),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
// Browser-side candidates, preferred first. The client cannot know the server
|
|
28
|
+
// config; when both cookies exist the prefixed one is the trustworthy one.
|
|
29
|
+
export function sessionCookieNameCandidates(base) {
|
|
30
|
+
return [sessionCookieName(base, { secure: true }), sessionCookieName(base, { secure: false })];
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.360.0",
|
|
4
4
|
"description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"types": "./dist/identifiers.d.ts",
|
|
27
27
|
"default": "./dist/identifiers.js"
|
|
28
28
|
},
|
|
29
|
+
"./session-cookies": {
|
|
30
|
+
"types": "./dist/session-cookies.d.ts",
|
|
31
|
+
"default": "./dist/session-cookies.js"
|
|
32
|
+
},
|
|
29
33
|
"./target-ref": {
|
|
30
34
|
"types": "./dist/target-ref.d.ts",
|
|
31
35
|
"default": "./dist/target-ref.js"
|
|
@@ -293,6 +297,10 @@
|
|
|
293
297
|
"types": "./dist/identifiers.d.ts",
|
|
294
298
|
"default": "./dist/identifiers.js"
|
|
295
299
|
},
|
|
300
|
+
"./session-cookies": {
|
|
301
|
+
"types": "./dist/session-cookies.d.ts",
|
|
302
|
+
"default": "./dist/session-cookies.js"
|
|
303
|
+
},
|
|
296
304
|
"./target-ref": {
|
|
297
305
|
"types": "./dist/target-ref.d.ts",
|
|
298
306
|
"default": "./dist/target-ref.js"
|