@valkyrianlabs/payload-markdown-docs 0.1.0-canary.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/README.md +195 -0
- package/dist/admin/DocsSetManager.d.ts +2 -0
- package/dist/admin/DocsSetManager.js +298 -0
- package/dist/admin/DocsSetManager.js.map +1 -0
- package/dist/admin/docsSetManagerData.d.ts +25 -0
- package/dist/admin/docsSetManagerData.js +266 -0
- package/dist/admin/docsSetManagerData.js.map +1 -0
- package/dist/admin/docsSetManagerTypes.d.ts +103 -0
- package/dist/admin/docsSetManagerTypes.js +3 -0
- package/dist/admin/docsSetManagerTypes.js.map +1 -0
- package/dist/admin/index.d.ts +3 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/cli/commands/install.d.ts +2 -0
- package/dist/cli/commands/install.js +211 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/keygen.d.ts +2 -0
- package/dist/cli/commands/keygen.js +89 -0
- package/dist/cli/commands/keygen.js.map +1 -0
- package/dist/cli/commands/manifest.d.ts +2 -0
- package/dist/cli/commands/manifest.js +50 -0
- package/dist/cli/commands/manifest.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +2 -0
- package/dist/cli/commands/plan.js +110 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/push.d.ts +3 -0
- package/dist/cli/commands/push.js +308 -0
- package/dist/cli/commands/push.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.js +109 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/filesystem.d.ts +20 -0
- package/dist/cli/filesystem.js +96 -0
- package/dist/cli/filesystem.js.map +1 -0
- package/dist/cli/format.d.ts +35 -0
- package/dist/cli/format.js +76 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/http.d.ts +19 -0
- package/dist/cli/http.js +39 -0
- package/dist/cli/http.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +214 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/parseArgs.d.ts +5 -0
- package/dist/cli/parseArgs.js +219 -0
- package/dist/cli/parseArgs.js.map +1 -0
- package/dist/cli/types.d.ts +51 -0
- package/dist/cli/types.js +3 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/collections/docs.d.ts +9 -0
- package/dist/collections/docs.js +168 -0
- package/dist/collections/docs.js.map +1 -0
- package/dist/collections/docsGroups.d.ts +5 -0
- package/dist/collections/docsGroups.js +57 -0
- package/dist/collections/docsGroups.js.map +1 -0
- package/dist/collections/docsSets.d.ts +8 -0
- package/dist/collections/docsSets.js +158 -0
- package/dist/collections/docsSets.js.map +1 -0
- package/dist/collections/index.d.ts +10 -0
- package/dist/collections/index.js +7 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/nonces.d.ts +6 -0
- package/dist/collections/nonces.js +57 -0
- package/dist/collections/nonces.js.map +1 -0
- package/dist/collections/syncRuns.d.ts +5 -0
- package/dist/collections/syncRuns.js +139 -0
- package/dist/collections/syncRuns.js.map +1 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.js +23 -0
- package/dist/constants.js.map +1 -0
- package/dist/endpoints/index.d.ts +2 -0
- package/dist/endpoints/index.js +3 -0
- package/dist/endpoints/index.js.map +1 -0
- package/dist/endpoints/sync.d.ts +47 -0
- package/dist/endpoints/sync.js +616 -0
- package/dist/endpoints/sync.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/next/PayloadMarkdownDocsPage.d.ts +7 -0
- package/dist/next/PayloadMarkdownDocsPage.js +142 -0
- package/dist/next/PayloadMarkdownDocsPage.js.map +1 -0
- package/dist/next/index.d.ts +9 -0
- package/dist/next/index.js +7 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/markdown.d.ts +14 -0
- package/dist/next/markdown.js +232 -0
- package/dist/next/markdown.js.map +1 -0
- package/dist/next/metadata.d.ts +3 -0
- package/dist/next/metadata.js +33 -0
- package/dist/next/metadata.js.map +1 -0
- package/dist/next/records.d.ts +14 -0
- package/dist/next/records.js +146 -0
- package/dist/next/records.js.map +1 -0
- package/dist/next/route.d.ts +6 -0
- package/dist/next/route.js +271 -0
- package/dist/next/route.js.map +1 -0
- package/dist/next/sidebar.d.ts +15 -0
- package/dist/next/sidebar.js +137 -0
- package/dist/next/sidebar.js.map +1 -0
- package/dist/next/types.d.ts +117 -0
- package/dist/next/types.js +3 -0
- package/dist/next/types.js.map +1 -0
- package/dist/payload/applyDocsSync.d.ts +54 -0
- package/dist/payload/applyDocsSync.js +176 -0
- package/dist/payload/applyDocsSync.js.map +1 -0
- package/dist/payload/docsConflicts.d.ts +12 -0
- package/dist/payload/docsConflicts.js +34 -0
- package/dist/payload/docsConflicts.js.map +1 -0
- package/dist/payload/docsData.d.ts +23 -0
- package/dist/payload/docsData.js +59 -0
- package/dist/payload/docsData.js.map +1 -0
- package/dist/payload/docsSets.d.ts +38 -0
- package/dist/payload/docsSets.js +57 -0
- package/dist/payload/docsSets.js.map +1 -0
- package/dist/payload/existingDocs.d.ts +43 -0
- package/dist/payload/existingDocs.js +97 -0
- package/dist/payload/existingDocs.js.map +1 -0
- package/dist/payload/index.d.ts +15 -0
- package/dist/payload/index.js +10 -0
- package/dist/payload/index.js.map +1 -0
- package/dist/payload/routeCollisions.d.ts +31 -0
- package/dist/payload/routeCollisions.js +104 -0
- package/dist/payload/routeCollisions.js.map +1 -0
- package/dist/payload/syncRuns.d.ts +60 -0
- package/dist/payload/syncRuns.js +53 -0
- package/dist/payload/syncRuns.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.js +165 -0
- package/dist/plugin.js.map +1 -0
- package/dist/routing/index.d.ts +3 -0
- package/dist/routing/index.js +4 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/paths.d.ts +7 -0
- package/dist/routing/paths.js +23 -0
- package/dist/routing/paths.js.map +1 -0
- package/dist/routing/reservations.d.ts +37 -0
- package/dist/routing/reservations.js +79 -0
- package/dist/routing/reservations.js.map +1 -0
- package/dist/security/canonical.d.ts +12 -0
- package/dist/security/canonical.js +24 -0
- package/dist/security/canonical.js.map +1 -0
- package/dist/security/githubOidc.d.ts +45 -0
- package/dist/security/githubOidc.js +177 -0
- package/dist/security/githubOidc.js.map +1 -0
- package/dist/security/headers.d.ts +22 -0
- package/dist/security/headers.js +44 -0
- package/dist/security/headers.js.map +1 -0
- package/dist/security/index.d.ts +15 -0
- package/dist/security/index.js +9 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/jwks.d.ts +20 -0
- package/dist/security/jwks.js +40 -0
- package/dist/security/jwks.js.map +1 -0
- package/dist/security/jwt.d.ts +10 -0
- package/dist/security/jwt.js +42 -0
- package/dist/security/jwt.js.map +1 -0
- package/dist/security/nonce.d.ts +34 -0
- package/dist/security/nonce.js +43 -0
- package/dist/security/nonce.js.map +1 -0
- package/dist/security/sign.d.ts +13 -0
- package/dist/security/sign.js +39 -0
- package/dist/security/sign.js.map +1 -0
- package/dist/security/verify.d.ts +28 -0
- package/dist/security/verify.js +54 -0
- package/dist/security/verify.js.map +1 -0
- package/dist/skills/codex/SKILL.md +173 -0
- package/dist/skills/codex/examples/docs-page.md +42 -0
- package/dist/skills/codex/examples/github-actions.md +64 -0
- package/dist/skills/codex/reference/admin.md +28 -0
- package/dist/skills/codex/reference/frontmatter.md +39 -0
- package/dist/skills/codex/reference/payload-markdown-directives.md +77 -0
- package/dist/skills/codex/reference/routing.md +35 -0
- package/dist/skills/codex/reference/sync.md +35 -0
- package/dist/skills/codex/reference/troubleshooting.md +53 -0
- package/dist/skills/codex/reference/workflow.md +39 -0
- package/dist/sync/aiExportManifest.d.ts +58 -0
- package/dist/sync/aiExportManifest.js +430 -0
- package/dist/sync/aiExportManifest.js.map +1 -0
- package/dist/sync/frontmatter.d.ts +28 -0
- package/dist/sync/frontmatter.js +210 -0
- package/dist/sync/frontmatter.js.map +1 -0
- package/dist/sync/hash.d.ts +1 -0
- package/dist/sync/hash.js +8 -0
- package/dist/sync/hash.js.map +1 -0
- package/dist/sync/index.d.ts +12 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/manifest.d.ts +58 -0
- package/dist/sync/manifest.js +21 -0
- package/dist/sync/manifest.js.map +1 -0
- package/dist/sync/paths.d.ts +16 -0
- package/dist/sync/paths.js +116 -0
- package/dist/sync/paths.js.map +1 -0
- package/dist/sync/plan.d.ts +29 -0
- package/dist/sync/plan.js +72 -0
- package/dist/sync/plan.js.map +1 -0
- package/dist/sync/validate.d.ts +26 -0
- package/dist/sync/validate.js +308 -0
- package/dist/sync/validate.js.map +1 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +143 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { markdownField } from '@valkyrianlabs/payload-markdown';
|
|
2
|
+
import { MANAGED_BY } from '../constants.js';
|
|
3
|
+
export const createDocsCollection = ({ slug, docsSetsCollectionSlug, enableDrafts = false, markdownFieldName, syncRunsCollectionSlug })=>({
|
|
4
|
+
slug,
|
|
5
|
+
admin: {
|
|
6
|
+
defaultColumns: [
|
|
7
|
+
'title',
|
|
8
|
+
'route',
|
|
9
|
+
'sourcePath',
|
|
10
|
+
'updatedAt'
|
|
11
|
+
],
|
|
12
|
+
hidden: true,
|
|
13
|
+
useAsTitle: 'title'
|
|
14
|
+
},
|
|
15
|
+
fields: [
|
|
16
|
+
{
|
|
17
|
+
name: 'title',
|
|
18
|
+
type: 'text',
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'navTitle',
|
|
23
|
+
type: 'text'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'description',
|
|
27
|
+
type: 'textarea'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'route',
|
|
31
|
+
type: 'text',
|
|
32
|
+
index: true,
|
|
33
|
+
required: true,
|
|
34
|
+
unique: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'sourcePath',
|
|
38
|
+
type: 'text',
|
|
39
|
+
index: true,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
...docsSetsCollectionSlug ? [
|
|
43
|
+
{
|
|
44
|
+
name: 'docsSet',
|
|
45
|
+
type: 'relationship',
|
|
46
|
+
index: true,
|
|
47
|
+
relationTo: docsSetsCollectionSlug
|
|
48
|
+
}
|
|
49
|
+
] : [],
|
|
50
|
+
{
|
|
51
|
+
name: 'sourceHash',
|
|
52
|
+
type: 'text',
|
|
53
|
+
index: true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'depth',
|
|
57
|
+
type: 'number',
|
|
58
|
+
defaultValue: 0
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'order',
|
|
62
|
+
type: 'number',
|
|
63
|
+
defaultValue: 0
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'parent',
|
|
67
|
+
type: 'relationship',
|
|
68
|
+
relationTo: slug
|
|
69
|
+
},
|
|
70
|
+
markdownField({
|
|
71
|
+
name: markdownFieldName,
|
|
72
|
+
label: 'Content'
|
|
73
|
+
}),
|
|
74
|
+
{
|
|
75
|
+
name: 'overrides',
|
|
76
|
+
type: 'group',
|
|
77
|
+
fields: [
|
|
78
|
+
{
|
|
79
|
+
name: 'navTitle',
|
|
80
|
+
type: 'text'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'hideFromNav',
|
|
84
|
+
type: 'checkbox',
|
|
85
|
+
defaultValue: false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'theme',
|
|
89
|
+
type: 'text'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'heroEyebrow',
|
|
93
|
+
type: 'text'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'heroTitle',
|
|
97
|
+
type: 'text'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'heroDescription',
|
|
101
|
+
type: 'textarea'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'seoTitle',
|
|
105
|
+
type: 'text'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'seoDescription',
|
|
109
|
+
type: 'textarea'
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'sync',
|
|
115
|
+
type: 'group',
|
|
116
|
+
fields: [
|
|
117
|
+
{
|
|
118
|
+
name: 'sourceId',
|
|
119
|
+
type: 'text',
|
|
120
|
+
index: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'sourcePath',
|
|
124
|
+
type: 'text',
|
|
125
|
+
index: true
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'sourceHashAtLastSync',
|
|
129
|
+
type: 'text',
|
|
130
|
+
index: true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'lastSyncedAt',
|
|
134
|
+
type: 'date'
|
|
135
|
+
},
|
|
136
|
+
...syncRunsCollectionSlug ? [
|
|
137
|
+
{
|
|
138
|
+
name: 'lastSyncRunId',
|
|
139
|
+
type: 'relationship',
|
|
140
|
+
relationTo: syncRunsCollectionSlug
|
|
141
|
+
}
|
|
142
|
+
] : [],
|
|
143
|
+
{
|
|
144
|
+
name: 'managedBy',
|
|
145
|
+
type: 'text',
|
|
146
|
+
defaultValue: MANAGED_BY
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'archived',
|
|
150
|
+
type: 'checkbox',
|
|
151
|
+
defaultValue: false,
|
|
152
|
+
index: true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'archivedAt',
|
|
156
|
+
type: 'date'
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
...enableDrafts ? {
|
|
162
|
+
versions: {
|
|
163
|
+
drafts: true
|
|
164
|
+
}
|
|
165
|
+
} : {}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/docs.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { markdownField } from '@valkyrianlabs/payload-markdown'\n\nimport { MANAGED_BY } from '../constants.js'\n\nexport type CreateDocsCollectionOptions = {\n docsSetsCollectionSlug?: string\n enableDrafts?: boolean\n markdownFieldName: string\n slug: string\n syncRunsCollectionSlug?: string\n}\n\nexport const createDocsCollection = ({\n slug,\n docsSetsCollectionSlug,\n enableDrafts = false,\n markdownFieldName,\n syncRunsCollectionSlug,\n}: CreateDocsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'route', 'sourcePath', 'updatedAt'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'route',\n type: 'text',\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n required: true,\n },\n ...(docsSetsCollectionSlug\n ? [\n {\n name: 'docsSet',\n type: 'relationship' as const,\n index: true,\n relationTo: docsSetsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'sourceHash',\n type: 'text',\n index: true,\n },\n {\n name: 'depth',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n markdownField({\n name: markdownFieldName,\n label: 'Content',\n }),\n {\n name: 'overrides',\n type: 'group',\n fields: [\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'hideFromNav',\n type: 'checkbox',\n defaultValue: false,\n },\n {\n name: 'theme',\n type: 'text',\n },\n {\n name: 'heroEyebrow',\n type: 'text',\n },\n {\n name: 'heroTitle',\n type: 'text',\n },\n {\n name: 'heroDescription',\n type: 'textarea',\n },\n {\n name: 'seoTitle',\n type: 'text',\n },\n {\n name: 'seoDescription',\n type: 'textarea',\n },\n ],\n },\n {\n name: 'sync',\n type: 'group',\n fields: [\n {\n name: 'sourceId',\n type: 'text',\n index: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n },\n {\n name: 'sourceHashAtLastSync',\n type: 'text',\n index: true,\n },\n {\n name: 'lastSyncedAt',\n type: 'date',\n },\n ...(syncRunsCollectionSlug\n ? [\n {\n name: 'lastSyncRunId',\n type: 'relationship' as const,\n relationTo: syncRunsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'managedBy',\n type: 'text',\n defaultValue: MANAGED_BY,\n },\n {\n name: 'archived',\n type: 'checkbox',\n defaultValue: false,\n index: true,\n },\n {\n name: 'archivedAt',\n type: 'date',\n },\n ],\n },\n ],\n ...(enableDrafts\n ? {\n versions: {\n drafts: true,\n },\n }\n : {}),\n})\n"],"names":["markdownField","MANAGED_BY","createDocsCollection","slug","docsSetsCollectionSlug","enableDrafts","markdownFieldName","syncRunsCollectionSlug","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","index","unique","relationTo","defaultValue","label","versions","drafts"],"mappings":"AAEA,SAASA,aAAa,QAAQ,kCAAiC;AAE/D,SAASC,UAAU,QAAQ,kBAAiB;AAU5C,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,IAAI,EACJC,sBAAsB,EACtBC,eAAe,KAAK,EACpBC,iBAAiB,EACjBC,sBAAsB,EACM,GAAwB,CAAA;QACpDJ;QACAK,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAS;gBAAc;aAAY;YAC7DC,QAAQ;YACRC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;gBACVE,QAAQ;YACV;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;eACIX,yBACA;gBACE;oBACES,MAAM;oBACNC,MAAM;oBACNE,OAAO;oBACPE,YAAYd;gBACd;aACD,GACD,EAAE;YACN;gBACES,MAAM;gBACNC,MAAM;gBACNE,OAAO;YACT;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNI,YAAYf;YACd;YACAH,cAAc;gBACZa,MAAMP;gBACNc,OAAO;YACT;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;wBACNK,cAAc;oBAChB;oBACA;wBACEN,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;iBACD;YACH;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;uBACIP,yBACA;wBACE;4BACEM,MAAM;4BACNC,MAAM;4BACNI,YAAYX;wBACd;qBACD,GACD,EAAE;oBACN;wBACEM,MAAM;wBACNC,MAAM;wBACNK,cAAclB;oBAChB;oBACA;wBACEY,MAAM;wBACNC,MAAM;wBACNK,cAAc;wBACdH,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;iBACD;YACH;SACD;QACD,GAAIT,eACA;YACEgB,UAAU;gBACRC,QAAQ;YACV;QACF,IACA,CAAC,CAAC;IACR,CAAA,EAAE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const createDocsGroupsCollection = ({ slug })=>({
|
|
2
|
+
slug,
|
|
3
|
+
admin: {
|
|
4
|
+
defaultColumns: [
|
|
5
|
+
'title',
|
|
6
|
+
'routePath',
|
|
7
|
+
'serveIndex',
|
|
8
|
+
'updatedAt'
|
|
9
|
+
],
|
|
10
|
+
group: 'Docs',
|
|
11
|
+
useAsTitle: 'title'
|
|
12
|
+
},
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
name: 'title',
|
|
16
|
+
type: 'text',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'slug',
|
|
21
|
+
type: 'text',
|
|
22
|
+
index: true,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'parent',
|
|
27
|
+
type: 'relationship',
|
|
28
|
+
relationTo: slug
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'routePath',
|
|
32
|
+
type: 'text',
|
|
33
|
+
index: true,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'description',
|
|
38
|
+
type: 'textarea'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'navTitle',
|
|
42
|
+
type: 'text'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'order',
|
|
46
|
+
type: 'number',
|
|
47
|
+
defaultValue: 0
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'serveIndex',
|
|
51
|
+
type: 'checkbox',
|
|
52
|
+
defaultValue: false
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=docsGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/docsGroups.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport type CreateDocsGroupsCollectionOptions = {\n slug: string\n}\n\nexport const createDocsGroupsCollection = ({\n slug,\n}: CreateDocsGroupsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'routePath', 'serveIndex', 'updatedAt'],\n group: 'Docs',\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'slug',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n {\n name: 'routePath',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'serveIndex',\n type: 'checkbox',\n defaultValue: false,\n },\n ],\n})\n"],"names":["createDocsGroupsCollection","slug","admin","defaultColumns","group","useAsTitle","fields","name","type","required","index","relationTo","defaultValue"],"mappings":"AAMA,OAAO,MAAMA,6BAA6B,CAAC,EACzCC,IAAI,EAC8B,GAAwB,CAAA;QAC1DA;QACAC,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAa;gBAAc;aAAY;YACjEC,OAAO;YACPC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNG,YAAYV;YACd;YACA;gBACEM,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;SACD;IACH,CAAA,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CollectionConfig } from 'payload';
|
|
2
|
+
export type CreateDocsSetsCollectionOptions = {
|
|
3
|
+
docsCollectionSlug?: string;
|
|
4
|
+
docsGroupsCollectionSlug: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
syncRunsCollectionSlug?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const createDocsSetsCollection: ({ slug, docsCollectionSlug, docsGroupsCollectionSlug, syncRunsCollectionSlug, }: CreateDocsSetsCollectionOptions) => CollectionConfig;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { DOCS_SET_MANAGER_COMPONENT } from '../constants.js';
|
|
2
|
+
export const createDocsSetsCollection = ({ slug, docsCollectionSlug, docsGroupsCollectionSlug, syncRunsCollectionSlug })=>({
|
|
3
|
+
slug,
|
|
4
|
+
admin: {
|
|
5
|
+
defaultColumns: [
|
|
6
|
+
'title',
|
|
7
|
+
'sourceId',
|
|
8
|
+
'routeBase',
|
|
9
|
+
'updatedAt'
|
|
10
|
+
],
|
|
11
|
+
group: 'Docs',
|
|
12
|
+
useAsTitle: 'title'
|
|
13
|
+
},
|
|
14
|
+
fields: [
|
|
15
|
+
{
|
|
16
|
+
name: 'title',
|
|
17
|
+
type: 'text',
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'slug',
|
|
22
|
+
type: 'text',
|
|
23
|
+
index: true,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'sourceId',
|
|
28
|
+
type: 'text',
|
|
29
|
+
index: true,
|
|
30
|
+
required: true,
|
|
31
|
+
unique: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'sourceRoot',
|
|
35
|
+
type: 'text',
|
|
36
|
+
defaultValue: 'docs'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'group',
|
|
40
|
+
type: 'relationship',
|
|
41
|
+
relationTo: docsGroupsCollectionSlug
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'routeBase',
|
|
45
|
+
type: 'text',
|
|
46
|
+
index: true,
|
|
47
|
+
required: true,
|
|
48
|
+
unique: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'description',
|
|
52
|
+
type: 'textarea'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'navTitle',
|
|
56
|
+
type: 'text'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'order',
|
|
60
|
+
type: 'number',
|
|
61
|
+
defaultValue: 0
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'defaults',
|
|
65
|
+
type: 'group',
|
|
66
|
+
fields: [
|
|
67
|
+
{
|
|
68
|
+
name: 'theme',
|
|
69
|
+
type: 'text'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'heroEyebrow',
|
|
73
|
+
type: 'text'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'heroTitle',
|
|
77
|
+
type: 'text'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'heroDescription',
|
|
81
|
+
type: 'textarea'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'seoTitle',
|
|
85
|
+
type: 'text'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'seoDescription',
|
|
89
|
+
type: 'textarea'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'sidebarMode',
|
|
93
|
+
type: 'select',
|
|
94
|
+
options: [
|
|
95
|
+
'auto',
|
|
96
|
+
'manual',
|
|
97
|
+
'hidden'
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'aiExport',
|
|
104
|
+
type: 'json',
|
|
105
|
+
admin: {
|
|
106
|
+
description: 'Parsed index.ai.yml control data for the raw Markdown AI export route.'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'sync',
|
|
111
|
+
type: 'group',
|
|
112
|
+
fields: [
|
|
113
|
+
{
|
|
114
|
+
name: 'lastSyncedAt',
|
|
115
|
+
type: 'date'
|
|
116
|
+
},
|
|
117
|
+
...syncRunsCollectionSlug ? [
|
|
118
|
+
{
|
|
119
|
+
name: 'lastSyncRunId',
|
|
120
|
+
type: 'relationship',
|
|
121
|
+
relationTo: syncRunsCollectionSlug
|
|
122
|
+
}
|
|
123
|
+
] : [],
|
|
124
|
+
{
|
|
125
|
+
name: 'lastStatus',
|
|
126
|
+
type: 'select',
|
|
127
|
+
options: [
|
|
128
|
+
'failed',
|
|
129
|
+
'pending',
|
|
130
|
+
'success'
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'docsCount',
|
|
135
|
+
type: 'number',
|
|
136
|
+
defaultValue: 0
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
...docsCollectionSlug ? [
|
|
141
|
+
{
|
|
142
|
+
name: 'docsSetManager',
|
|
143
|
+
type: 'ui',
|
|
144
|
+
admin: {
|
|
145
|
+
components: {
|
|
146
|
+
Field: DOCS_SET_MANAGER_COMPONENT
|
|
147
|
+
},
|
|
148
|
+
custom: {
|
|
149
|
+
docsCollectionSlug,
|
|
150
|
+
docsSetsCollectionSlug: slug
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
] : []
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=docsSets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/docsSets.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { DOCS_SET_MANAGER_COMPONENT } from '../constants.js'\n\nexport type CreateDocsSetsCollectionOptions = {\n docsCollectionSlug?: string\n docsGroupsCollectionSlug: string\n slug: string\n syncRunsCollectionSlug?: string\n}\n\nexport const createDocsSetsCollection = ({\n slug,\n docsCollectionSlug,\n docsGroupsCollectionSlug,\n syncRunsCollectionSlug,\n}: CreateDocsSetsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'sourceId', 'routeBase', 'updatedAt'],\n group: 'Docs',\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'slug',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'sourceId',\n type: 'text',\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'sourceRoot',\n type: 'text',\n defaultValue: 'docs',\n },\n {\n name: 'group',\n type: 'relationship',\n relationTo: docsGroupsCollectionSlug,\n },\n {\n name: 'routeBase',\n type: 'text',\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'defaults',\n type: 'group',\n fields: [\n {\n name: 'theme',\n type: 'text',\n },\n {\n name: 'heroEyebrow',\n type: 'text',\n },\n {\n name: 'heroTitle',\n type: 'text',\n },\n {\n name: 'heroDescription',\n type: 'textarea',\n },\n {\n name: 'seoTitle',\n type: 'text',\n },\n {\n name: 'seoDescription',\n type: 'textarea',\n },\n {\n name: 'sidebarMode',\n type: 'select',\n options: ['auto', 'manual', 'hidden'],\n },\n ],\n },\n {\n name: 'aiExport',\n type: 'json',\n admin: {\n description:\n 'Parsed index.ai.yml control data for the raw Markdown AI export route.',\n },\n },\n {\n name: 'sync',\n type: 'group',\n fields: [\n {\n name: 'lastSyncedAt',\n type: 'date',\n },\n ...(syncRunsCollectionSlug\n ? [\n {\n name: 'lastSyncRunId',\n type: 'relationship' as const,\n relationTo: syncRunsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'lastStatus',\n type: 'select',\n options: ['failed', 'pending', 'success'],\n },\n {\n name: 'docsCount',\n type: 'number',\n defaultValue: 0,\n },\n ],\n },\n ...(docsCollectionSlug\n ? [\n {\n name: 'docsSetManager',\n type: 'ui' as const,\n admin: {\n components: {\n Field: DOCS_SET_MANAGER_COMPONENT,\n },\n custom: {\n docsCollectionSlug,\n docsSetsCollectionSlug: slug,\n },\n },\n },\n ]\n : []),\n ],\n})\n"],"names":["DOCS_SET_MANAGER_COMPONENT","createDocsSetsCollection","slug","docsCollectionSlug","docsGroupsCollectionSlug","syncRunsCollectionSlug","admin","defaultColumns","group","useAsTitle","fields","name","type","required","index","unique","defaultValue","relationTo","options","description","components","Field","custom","docsSetsCollectionSlug"],"mappings":"AAEA,SAASA,0BAA0B,QAAQ,kBAAiB;AAS5D,OAAO,MAAMC,2BAA2B,CAAC,EACvCC,IAAI,EACJC,kBAAkB,EAClBC,wBAAwB,EACxBC,sBAAsB,EACU,GAAwB,CAAA;QACxDH;QACAI,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAY;gBAAa;aAAY;YAC/DC,OAAO;YACPC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;gBACVE,QAAQ;YACV;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNK,YAAYb;YACd;YACA;gBACEO,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;gBACVE,QAAQ;YACV;YACA;gBACEJ,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;wBACNM,SAAS;4BAAC;4BAAQ;4BAAU;yBAAS;oBACvC;iBACD;YACH;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLa,aACE;gBACJ;YACF;YACA;gBACER,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;oBACR;uBACIP,yBACA;wBACE;4BACEM,MAAM;4BACNC,MAAM;4BACNK,YAAYZ;wBACd;qBACD,GACD,EAAE;oBACN;wBACEM,MAAM;wBACNC,MAAM;wBACNM,SAAS;4BAAC;4BAAU;4BAAW;yBAAU;oBAC3C;oBACA;wBACEP,MAAM;wBACNC,MAAM;wBACNI,cAAc;oBAChB;iBACD;YACH;eACIb,qBACA;gBACE;oBACEQ,MAAM;oBACNC,MAAM;oBACNN,OAAO;wBACLc,YAAY;4BACVC,OAAOrB;wBACT;wBACAsB,QAAQ;4BACNnB;4BACAoB,wBAAwBrB;wBAC1B;oBACF;gBACF;aACD,GACD,EAAE;SACP;IACH,CAAA,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createDocsCollection } from './docs.js';
|
|
2
|
+
export type { CreateDocsCollectionOptions } from './docs.js';
|
|
3
|
+
export { createDocsGroupsCollection } from './docsGroups.js';
|
|
4
|
+
export type { CreateDocsGroupsCollectionOptions } from './docsGroups.js';
|
|
5
|
+
export { createDocsSetsCollection } from './docsSets.js';
|
|
6
|
+
export type { CreateDocsSetsCollectionOptions } from './docsSets.js';
|
|
7
|
+
export { createNoncesCollection } from './nonces.js';
|
|
8
|
+
export type { CreateNoncesCollectionOptions } from './nonces.js';
|
|
9
|
+
export { createSyncRunsCollection } from './syncRuns.js';
|
|
10
|
+
export type { CreateSyncRunsCollectionOptions } from './syncRuns.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createDocsCollection } from './docs.js';
|
|
2
|
+
export { createDocsGroupsCollection } from './docsGroups.js';
|
|
3
|
+
export { createDocsSetsCollection } from './docsSets.js';
|
|
4
|
+
export { createNoncesCollection } from './nonces.js';
|
|
5
|
+
export { createSyncRunsCollection } from './syncRuns.js';
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/index.ts"],"sourcesContent":["export { createDocsCollection } from './docs.js'\nexport type { CreateDocsCollectionOptions } from './docs.js'\nexport { createDocsGroupsCollection } from './docsGroups.js'\nexport type { CreateDocsGroupsCollectionOptions } from './docsGroups.js'\nexport { createDocsSetsCollection } from './docsSets.js'\nexport type { CreateDocsSetsCollectionOptions } from './docsSets.js'\nexport { createNoncesCollection } from './nonces.js'\nexport type { CreateNoncesCollectionOptions } from './nonces.js'\nexport { createSyncRunsCollection } from './syncRuns.js'\nexport type { CreateSyncRunsCollectionOptions } from './syncRuns.js'\n"],"names":["createDocsCollection","createDocsGroupsCollection","createDocsSetsCollection","createNoncesCollection","createSyncRunsCollection"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAW;AAEhD,SAASC,0BAA0B,QAAQ,kBAAiB;AAE5D,SAASC,wBAAwB,QAAQ,gBAAe;AAExD,SAASC,sBAAsB,QAAQ,cAAa;AAEpD,SAASC,wBAAwB,QAAQ,gBAAe"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CollectionConfig } from 'payload';
|
|
2
|
+
export type CreateNoncesCollectionOptions = {
|
|
3
|
+
slug: string;
|
|
4
|
+
syncRunsCollectionSlug?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const createNoncesCollection: ({ slug, syncRunsCollectionSlug, }: CreateNoncesCollectionOptions) => CollectionConfig;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const createNoncesCollection = ({ slug, syncRunsCollectionSlug })=>({
|
|
2
|
+
slug,
|
|
3
|
+
admin: {
|
|
4
|
+
defaultColumns: [
|
|
5
|
+
'keyId',
|
|
6
|
+
'nonce',
|
|
7
|
+
'sourceId',
|
|
8
|
+
'expiresAt',
|
|
9
|
+
'usedAt'
|
|
10
|
+
],
|
|
11
|
+
hidden: true,
|
|
12
|
+
useAsTitle: 'nonce'
|
|
13
|
+
},
|
|
14
|
+
fields: [
|
|
15
|
+
{
|
|
16
|
+
name: 'keyId',
|
|
17
|
+
type: 'text',
|
|
18
|
+
index: true,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'nonce',
|
|
23
|
+
type: 'text',
|
|
24
|
+
index: true,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'sourceId',
|
|
29
|
+
type: 'text',
|
|
30
|
+
index: true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'bodyHash',
|
|
34
|
+
type: 'text',
|
|
35
|
+
index: true
|
|
36
|
+
},
|
|
37
|
+
...syncRunsCollectionSlug ? [
|
|
38
|
+
{
|
|
39
|
+
name: 'syncRunId',
|
|
40
|
+
type: 'relationship',
|
|
41
|
+
relationTo: syncRunsCollectionSlug
|
|
42
|
+
}
|
|
43
|
+
] : [],
|
|
44
|
+
{
|
|
45
|
+
name: 'expiresAt',
|
|
46
|
+
type: 'date',
|
|
47
|
+
index: true,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'usedAt',
|
|
52
|
+
type: 'date'
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=nonces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/nonces.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport type CreateNoncesCollectionOptions = {\n slug: string\n syncRunsCollectionSlug?: string\n}\n\nexport const createNoncesCollection = ({\n slug,\n syncRunsCollectionSlug,\n}: CreateNoncesCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['keyId', 'nonce', 'sourceId', 'expiresAt', 'usedAt'],\n hidden: true,\n useAsTitle: 'nonce',\n },\n fields: [\n {\n name: 'keyId',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'nonce',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'sourceId',\n type: 'text',\n index: true,\n },\n {\n name: 'bodyHash',\n type: 'text',\n index: true,\n },\n ...(syncRunsCollectionSlug\n ? [\n {\n name: 'syncRunId',\n type: 'relationship' as const,\n relationTo: syncRunsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'expiresAt',\n type: 'date',\n index: true,\n required: true,\n },\n {\n name: 'usedAt',\n type: 'date',\n },\n ],\n})\n"],"names":["createNoncesCollection","slug","syncRunsCollectionSlug","admin","defaultColumns","hidden","useAsTitle","fields","name","type","index","required","relationTo"],"mappings":"AAOA,OAAO,MAAMA,yBAAyB,CAAC,EACrCC,IAAI,EACJC,sBAAsB,EACQ,GAAwB,CAAA;QACtDD;QACAE,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAS;gBAAY;gBAAa;aAAS;YACrEC,QAAQ;YACRC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNC,OAAO;YACT;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNC,OAAO;YACT;eACIR,yBACA;gBACE;oBACEM,MAAM;oBACNC,MAAM;oBACNG,YAAYV;gBACd;aACD,GACD,EAAE;YACN;gBACEM,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEH,MAAM;gBACNC,MAAM;YACR;SACD;IACH,CAAA,EAAE"}
|