@vitrine-kit/payload-blueprint 0.2.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BlueprintFieldDef, Extend } from '@vitrine-kit/contracts';
2
2
 
3
- declare const PAYLOAD_BLUEPRINT_VERSION: "0.2.2";
3
+ declare const PAYLOAD_BLUEPRINT_VERSION: "0.2.3";
4
4
 
5
5
  interface BlueprintCollectionConfig {
6
6
  slug: string;
package/dist/index.js CHANGED
@@ -1,13 +1,15 @@
1
1
  // src/version.generated.ts
2
- var PAYLOAD_BLUEPRINT_VERSION = "0.2.2";
2
+ var PAYLOAD_BLUEPRINT_VERSION = "0.2.3";
3
3
 
4
4
  // src/collections.ts
5
5
  var f = (name, type, extra = {}) => ({ name, type, ...extra });
6
6
  var authenticated = ({ req }) => Boolean(req?.user);
7
7
  var adminOnly = { read: authenticated, create: authenticated, update: authenticated, delete: authenticated };
8
+ var publicRead = { read: () => true, create: authenticated, update: authenticated, delete: authenticated };
8
9
  var categoriesCollection = {
9
10
  slug: "categories",
10
11
  admin: { useAsTitle: "title" },
12
+ access: publicRead,
11
13
  fields: [
12
14
  f("title", "text", { required: true }),
13
15
  f("slug", "text", { required: true, unique: true, index: true }),
@@ -18,16 +20,20 @@ var categoriesCollection = {
18
20
  var mediaCollection = {
19
21
  slug: "media",
20
22
  upload: true,
23
+ access: publicRead,
21
24
  fields: [f("alt", "text")]
22
25
  };
23
26
  var usersCollection = {
24
27
  slug: "users",
25
- auth: true,
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,
26
31
  fields: [f("email", "text", { required: true })]
27
32
  };
28
33
  var variantsCollection = {
29
34
  slug: "variants",
30
35
  admin: { useAsTitle: "sku" },
36
+ access: publicRead,
31
37
  fields: [
32
38
  f("sku", "text", { required: true, unique: true, index: true }),
33
39
  f("product", "relationship", { relationTo: "products", required: true }),
@@ -41,6 +47,7 @@ var variantsCollection = {
41
47
  var productsCollection = {
42
48
  slug: "products",
43
49
  admin: { useAsTitle: "title" },
50
+ access: publicRead,
44
51
  fields: [
45
52
  f("title", "text", { required: true }),
46
53
  f("slug", "text", { required: true, unique: true, index: true }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrine-kit/payload-blueprint",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Vitrine — base Payload collections + additive extend().",
5
5
  "license": "MIT",
6
6
  "type": "module",