@vitrine-kit/payload-blueprint 0.2.1 → 0.2.3
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/index.d.ts +2 -2
- package/dist/index.js +11 -4
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BlueprintFieldDef, Extend } from '@vitrine-kit/contracts';
|
|
2
2
|
|
|
3
|
+
declare const PAYLOAD_BLUEPRINT_VERSION: "0.2.3";
|
|
4
|
+
|
|
3
5
|
interface BlueprintCollectionConfig {
|
|
4
6
|
slug: string;
|
|
5
7
|
fields: BlueprintFieldDef[];
|
|
@@ -23,6 +25,4 @@ interface Blueprint {
|
|
|
23
25
|
}
|
|
24
26
|
declare function createBlueprint(): Blueprint;
|
|
25
27
|
|
|
26
|
-
declare const PAYLOAD_BLUEPRINT_VERSION: "0.1.0";
|
|
27
|
-
|
|
28
28
|
export { type Blueprint, type BlueprintCollectionConfig, PAYLOAD_BLUEPRINT_VERSION, baseCollections, cartsCollection, categoriesCollection, createBlueprint, mediaCollection, ordersCollection, productsCollection, usersCollection, variantsCollection };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
// src/version.generated.ts
|
|
2
|
+
var PAYLOAD_BLUEPRINT_VERSION = "0.2.3";
|
|
3
|
+
|
|
1
4
|
// src/collections.ts
|
|
2
5
|
var f = (name, type, extra = {}) => ({ name, type, ...extra });
|
|
3
6
|
var authenticated = ({ req }) => Boolean(req?.user);
|
|
4
7
|
var adminOnly = { read: authenticated, create: authenticated, update: authenticated, delete: authenticated };
|
|
8
|
+
var publicRead = { read: () => true, create: authenticated, update: authenticated, delete: authenticated };
|
|
5
9
|
var categoriesCollection = {
|
|
6
10
|
slug: "categories",
|
|
7
11
|
admin: { useAsTitle: "title" },
|
|
12
|
+
access: publicRead,
|
|
8
13
|
fields: [
|
|
9
14
|
f("title", "text", { required: true }),
|
|
10
15
|
f("slug", "text", { required: true, unique: true, index: true }),
|
|
@@ -15,16 +20,20 @@ var categoriesCollection = {
|
|
|
15
20
|
var mediaCollection = {
|
|
16
21
|
slug: "media",
|
|
17
22
|
upload: true,
|
|
23
|
+
access: publicRead,
|
|
18
24
|
fields: [f("alt", "text")]
|
|
19
25
|
};
|
|
20
26
|
var usersCollection = {
|
|
21
27
|
slug: "users",
|
|
22
|
-
|
|
28
|
+
// maxLoginAttempts/lockTime — Payload's built-in brute-force lockout on the login endpoint.
|
|
29
|
+
auth: { maxLoginAttempts: 5, lockTime: 10 * 60 * 1e3 },
|
|
30
|
+
access: adminOnly,
|
|
23
31
|
fields: [f("email", "text", { required: true })]
|
|
24
32
|
};
|
|
25
33
|
var variantsCollection = {
|
|
26
34
|
slug: "variants",
|
|
27
35
|
admin: { useAsTitle: "sku" },
|
|
36
|
+
access: publicRead,
|
|
28
37
|
fields: [
|
|
29
38
|
f("sku", "text", { required: true, unique: true, index: true }),
|
|
30
39
|
f("product", "relationship", { relationTo: "products", required: true }),
|
|
@@ -38,6 +47,7 @@ var variantsCollection = {
|
|
|
38
47
|
var productsCollection = {
|
|
39
48
|
slug: "products",
|
|
40
49
|
admin: { useAsTitle: "title" },
|
|
50
|
+
access: publicRead,
|
|
41
51
|
fields: [
|
|
42
52
|
f("title", "text", { required: true }),
|
|
43
53
|
f("slug", "text", { required: true, unique: true, index: true }),
|
|
@@ -133,9 +143,6 @@ function createBlueprint() {
|
|
|
133
143
|
}
|
|
134
144
|
return { extend, build };
|
|
135
145
|
}
|
|
136
|
-
|
|
137
|
-
// src/index.ts
|
|
138
|
-
var PAYLOAD_BLUEPRINT_VERSION = "0.1.0";
|
|
139
146
|
export {
|
|
140
147
|
PAYLOAD_BLUEPRINT_VERSION,
|
|
141
148
|
baseCollections,
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitrine-kit/payload-blueprint",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Vitrine — base Payload collections + additive extend().",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
7
11
|
"types": "./dist/index.d.ts",
|
|
8
12
|
"main": "./dist/index.js",
|
|
9
13
|
"module": "./dist/index.js",
|
|
@@ -25,11 +29,11 @@
|
|
|
25
29
|
"directory": "packages/payload-blueprint"
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
|
-
"@vitrine-kit/contracts": "1.2.
|
|
32
|
+
"@vitrine-kit/contracts": "1.2.1"
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
31
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
32
|
-
"typecheck": "tsc --noEmit",
|
|
35
|
+
"build": "node scripts/generate-version.mjs && tsup src/index.ts --format esm --dts --clean",
|
|
36
|
+
"typecheck": "node scripts/generate-version.mjs && tsc --noEmit",
|
|
33
37
|
"test": "vitest run --passWithNoTests"
|
|
34
38
|
}
|
|
35
39
|
}
|