@scalar/oas-utils 0.2.97 → 0.2.99
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @scalar/oas-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.99
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c803e2d: feat: cookies 🍪
|
|
8
|
+
|
|
9
|
+
## 0.2.98
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [b552db5]
|
|
14
|
+
- @scalar/types@0.0.27
|
|
15
|
+
- @scalar/themes@0.9.61
|
|
16
|
+
|
|
3
17
|
## 0.2.97
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -6,60 +6,20 @@ export declare const cookieSchema: z.ZodObject<{
|
|
|
6
6
|
value: z.ZodDefault<z.ZodString>;
|
|
7
7
|
/** Defines the host to which the cookie will be sent. */
|
|
8
8
|
domain: z.ZodOptional<z.ZodString>;
|
|
9
|
-
/** Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. */
|
|
10
|
-
expires: z.ZodOptional<z.ZodDate>;
|
|
11
|
-
/**
|
|
12
|
-
* Forbids JavaScript from accessing the cookie, for example, through the Document.cookie property. Note that a cookie
|
|
13
|
-
* that has been created with HttpOnly will still be sent with JavaScript-initiated requests, for example, when
|
|
14
|
-
* calling XMLHttpRequest.send() or fetch(). This mitigates attacks against cross-site scripting (XSS).
|
|
15
|
-
*/
|
|
16
|
-
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie
|
|
19
|
-
* immediately. If both Expires and Max-Age are set, Max-Age has precedence.
|
|
20
|
-
*/
|
|
21
|
-
maxAge: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
/**
|
|
23
|
-
* Indicates that the cookie should be stored using partitioned storage. See Cookies Having Independent Partitioned
|
|
24
|
-
* State (CHIPS) for more details.
|
|
25
|
-
*/
|
|
26
|
-
partitioned: z.ZodOptional<z.ZodBoolean>;
|
|
27
9
|
/** Indicates the path that must exist in the requested URL for the browser to send the Cookie header. */
|
|
28
10
|
path: z.ZodOptional<z.ZodString>;
|
|
29
|
-
/**
|
|
30
|
-
* Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site
|
|
31
|
-
* request forgery attacks (CSRF).
|
|
32
|
-
*/
|
|
33
|
-
sameSite: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"Lax">, z.ZodLiteral<"Strict">, z.ZodLiteral<"None">]>>;
|
|
34
|
-
/**
|
|
35
|
-
* Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on
|
|
36
|
-
* localhost), and therefore, is more resistant to man-in-the-middle attacks.
|
|
37
|
-
*/
|
|
38
|
-
secure: z.ZodOptional<z.ZodBoolean>;
|
|
39
11
|
}, "strip", z.ZodTypeAny, {
|
|
40
12
|
value: string;
|
|
41
13
|
uid: string;
|
|
42
14
|
name: string;
|
|
43
|
-
sameSite: "Lax" | "Strict" | "None";
|
|
44
15
|
path?: string | undefined;
|
|
45
16
|
domain?: string | undefined;
|
|
46
|
-
expires?: Date | undefined;
|
|
47
|
-
httpOnly?: boolean | undefined;
|
|
48
|
-
maxAge?: number | undefined;
|
|
49
|
-
partitioned?: boolean | undefined;
|
|
50
|
-
secure?: boolean | undefined;
|
|
51
17
|
}, {
|
|
52
18
|
path?: string | undefined;
|
|
53
19
|
value?: string | undefined;
|
|
54
20
|
uid?: string | undefined;
|
|
55
21
|
name?: string | undefined;
|
|
56
22
|
domain?: string | undefined;
|
|
57
|
-
expires?: Date | undefined;
|
|
58
|
-
httpOnly?: boolean | undefined;
|
|
59
|
-
maxAge?: number | undefined;
|
|
60
|
-
partitioned?: boolean | undefined;
|
|
61
|
-
sameSite?: "Lax" | "Strict" | "None" | undefined;
|
|
62
|
-
secure?: boolean | undefined;
|
|
63
23
|
}>;
|
|
64
24
|
/**
|
|
65
25
|
* Cookies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../src/entities/cookie/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,YAAY;;IAEvB,kGAAkG;;;IAGlG,yDAAyD;;IAEzD,
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../src/entities/cookie/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,YAAY;;IAEvB,kGAAkG;;;IAGlG,yDAAyD;;IAEzD,yGAAyG;;;;;;;;;;;;;;EAEzG,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
@@ -4,42 +4,12 @@ import { nanoidSchema } from '../shared/utility.js';
|
|
|
4
4
|
const cookieSchema = z.object({
|
|
5
5
|
uid: nanoidSchema,
|
|
6
6
|
/** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
|
|
7
|
-
name: z.string().default('
|
|
8
|
-
value: z.string().default('
|
|
7
|
+
name: z.string().default(''),
|
|
8
|
+
value: z.string().default(''),
|
|
9
9
|
/** Defines the host to which the cookie will be sent. */
|
|
10
10
|
domain: z.string().optional(),
|
|
11
|
-
/** Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. */
|
|
12
|
-
expires: z.date().optional(),
|
|
13
|
-
/**
|
|
14
|
-
* Forbids JavaScript from accessing the cookie, for example, through the Document.cookie property. Note that a cookie
|
|
15
|
-
* that has been created with HttpOnly will still be sent with JavaScript-initiated requests, for example, when
|
|
16
|
-
* calling XMLHttpRequest.send() or fetch(). This mitigates attacks against cross-site scripting (XSS).
|
|
17
|
-
*/
|
|
18
|
-
httpOnly: z.boolean().optional(),
|
|
19
|
-
/**
|
|
20
|
-
* Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie
|
|
21
|
-
* immediately. If both Expires and Max-Age are set, Max-Age has precedence.
|
|
22
|
-
*/
|
|
23
|
-
maxAge: z.number().optional(),
|
|
24
|
-
/**
|
|
25
|
-
* Indicates that the cookie should be stored using partitioned storage. See Cookies Having Independent Partitioned
|
|
26
|
-
* State (CHIPS) for more details.
|
|
27
|
-
*/
|
|
28
|
-
partitioned: z.boolean().optional(),
|
|
29
11
|
/** Indicates the path that must exist in the requested URL for the browser to send the Cookie header. */
|
|
30
12
|
path: z.string().optional(),
|
|
31
|
-
/**
|
|
32
|
-
* Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site
|
|
33
|
-
* request forgery attacks (CSRF).
|
|
34
|
-
*/
|
|
35
|
-
sameSite: z
|
|
36
|
-
.union([z.literal('Lax'), z.literal('Strict'), z.literal('None')])
|
|
37
|
-
.default('None'),
|
|
38
|
-
/**
|
|
39
|
-
* Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on
|
|
40
|
-
* localhost), and therefore, is more resistant to man-in-the-middle attacks.
|
|
41
|
-
*/
|
|
42
|
-
secure: z.boolean().optional(),
|
|
43
13
|
});
|
|
44
14
|
|
|
45
15
|
export { cookieSchema };
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"specification",
|
|
17
17
|
"yaml"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.99",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -121,18 +121,18 @@
|
|
|
121
121
|
"nanoid": "^5.0.7",
|
|
122
122
|
"yaml": "^2.4.5",
|
|
123
123
|
"zod": "^3.23.8",
|
|
124
|
-
"@scalar/
|
|
125
|
-
"@scalar/
|
|
126
|
-
"@scalar/
|
|
127
|
-
"@scalar/
|
|
124
|
+
"@scalar/object-utils": "1.1.12",
|
|
125
|
+
"@scalar/types": "0.0.27",
|
|
126
|
+
"@scalar/themes": "0.9.61",
|
|
127
|
+
"@scalar/openapi-types": "0.1.6"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"type-fest": "^4.20.0",
|
|
131
131
|
"vite": "^5.4.10",
|
|
132
132
|
"vitest": "^1.6.0",
|
|
133
133
|
"zod-to-ts": "github:amritk/zod-to-ts#build",
|
|
134
|
-
"@scalar/build-tooling": "0.1.12",
|
|
135
134
|
"@scalar/openapi-parser": "0.10.4",
|
|
135
|
+
"@scalar/build-tooling": "0.1.12",
|
|
136
136
|
"@scalar/openapi-types": "0.1.6"
|
|
137
137
|
},
|
|
138
138
|
"scripts": {
|