@payloadcms/payload-cloud 3.14.1-canary.f9e1e85 → 3.15.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/plugin.d.ts.map +1 -1
- package/dist/plugin.js +0 -71
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +0 -48
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -5
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAW/C,eAAO,MAAM,kBAAkB,mBACZ,aAAa,sBACP,MAAM,KAAG,OAAO,CAAC,MAAM,CAiF7C,CAAA"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Cron } from 'croner';
|
|
2
1
|
import { payloadCloudEmail } from './email.js';
|
|
3
2
|
import { getAfterDeleteHook } from './hooks/afterDelete.js';
|
|
4
3
|
import { getBeforeChangeHook } from './hooks/beforeChange.js';
|
|
@@ -83,77 +82,7 @@ export const payloadCloudPlugin = (pluginOptions)=>async (incomingConfig)=>{
|
|
|
83
82
|
skipVerify: pluginOptions?.email?.skipVerify
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
|
-
// We set up cron jobs on init.
|
|
87
|
-
// We also make sure to only run on one instance using a instance identifier stored in a global.
|
|
88
|
-
// If you modify this defaults, make sure to update the TsDoc in the types file.
|
|
89
|
-
const DEFAULT_CRON = '* * * * *';
|
|
90
|
-
const DEFAULT_LIMIT = 10;
|
|
91
|
-
const DEFAULT_CRON_JOB = {
|
|
92
|
-
cron: DEFAULT_CRON,
|
|
93
|
-
limit: DEFAULT_LIMIT,
|
|
94
|
-
queue: 'default (every minute)'
|
|
95
|
-
};
|
|
96
|
-
config.globals = [
|
|
97
|
-
...config.globals || [],
|
|
98
|
-
{
|
|
99
|
-
slug: 'payload-cloud-instance',
|
|
100
|
-
admin: {
|
|
101
|
-
hidden: true
|
|
102
|
-
},
|
|
103
|
-
fields: [
|
|
104
|
-
{
|
|
105
|
-
name: 'instance',
|
|
106
|
-
type: 'text',
|
|
107
|
-
required: true
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
const newOnInit = async (payload)=>{
|
|
113
|
-
if (config.onInit) {
|
|
114
|
-
await config.onInit(payload);
|
|
115
|
-
}
|
|
116
|
-
const instance = generateRandomString();
|
|
117
|
-
await payload.updateGlobal({
|
|
118
|
-
slug: 'payload-cloud-instance',
|
|
119
|
-
data: {
|
|
120
|
-
instance
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
await waitRandomTime();
|
|
124
|
-
const cloudInstance = await payload.findGlobal({
|
|
125
|
-
slug: 'payload-cloud-instance'
|
|
126
|
-
});
|
|
127
|
-
const cronJobs = pluginOptions?.cronJobs?.run ?? [
|
|
128
|
-
DEFAULT_CRON_JOB
|
|
129
|
-
];
|
|
130
|
-
if (cloudInstance.instance === instance) {
|
|
131
|
-
cronJobs.forEach((cronConfig)=>{
|
|
132
|
-
new Cron(cronConfig.cron ?? DEFAULT_CRON, async ()=>{
|
|
133
|
-
await payload.jobs.run({
|
|
134
|
-
limit: cronConfig.limit ?? DEFAULT_LIMIT,
|
|
135
|
-
queue: cronConfig.queue
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
config.onInit = newOnInit;
|
|
142
85
|
return config;
|
|
143
86
|
};
|
|
144
|
-
function waitRandomTime() {
|
|
145
|
-
const min = 1000 // 1 second in milliseconds
|
|
146
|
-
;
|
|
147
|
-
const max = 5000 // 5 seconds in milliseconds
|
|
148
|
-
;
|
|
149
|
-
const randomTime = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
150
|
-
return new Promise((resolve)=>setTimeout(resolve, randomTime));
|
|
151
|
-
}
|
|
152
|
-
function generateRandomString() {
|
|
153
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
154
|
-
return Array.from({
|
|
155
|
-
length: 24
|
|
156
|
-
}, ()=>chars[Math.floor(Math.random() * chars.length)]).join('');
|
|
157
|
-
}
|
|
158
87
|
|
|
159
88
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport type { PluginOptions } from './types.js'\n\nimport { payloadCloudEmail } from './email.js'\nimport { getAfterDeleteHook } from './hooks/afterDelete.js'\nimport { getBeforeChangeHook } from './hooks/beforeChange.js'\nimport {\n getCacheUploadsAfterChangeHook,\n getCacheUploadsAfterDeleteHook,\n} from './hooks/uploadCache.js'\nimport { getStaticHandler } from './staticHandler.js'\n\nexport const payloadCloudPlugin =\n (pluginOptions?: PluginOptions) =>\n async (incomingConfig: Config): Promise<Config> => {\n let config = { ...incomingConfig }\n\n if (process.env.PAYLOAD_CLOUD !== 'true') {\n return config\n }\n\n const cachingEnabled =\n pluginOptions?.uploadCaching !== false && !!process.env.PAYLOAD_CLOUD_CACHE_KEY\n\n const apiEndpoint = pluginOptions?.endpoint || 'https://cloud-api.payloadcms.com'\n\n // Configure cloud storage\n if (pluginOptions?.storage !== false) {\n config = {\n ...config,\n collections: (config.collections || []).map((collection) => {\n if (collection.upload) {\n return {\n ...collection,\n hooks: {\n ...(collection.hooks || {}),\n afterChange: [\n ...(collection.hooks?.afterChange || []),\n ...(cachingEnabled\n ? [getCacheUploadsAfterChangeHook({ endpoint: apiEndpoint })]\n : []),\n ],\n afterDelete: [\n ...(collection.hooks?.afterDelete || []),\n getAfterDeleteHook({ collection }),\n ...(cachingEnabled\n ? [getCacheUploadsAfterDeleteHook({ endpoint: apiEndpoint })]\n : []),\n ],\n beforeChange: [\n ...(collection.hooks?.beforeChange || []),\n getBeforeChangeHook({ collection }),\n ],\n },\n upload: {\n ...(typeof collection.upload === 'object' ? collection.upload : {}),\n disableLocalStorage: true,\n handlers: [\n ...(typeof collection.upload === 'object' &&\n Array.isArray(collection.upload.handlers)\n ? collection.upload.handlers\n : []),\n getStaticHandler({\n cachingOptions: pluginOptions?.uploadCaching,\n collection,\n }),\n ],\n },\n }\n }\n\n return collection\n }),\n upload: {\n ...(config.upload || {}),\n useTempFiles: true,\n },\n }\n }\n\n // Configure cloud email\n const apiKey = process.env.PAYLOAD_CLOUD_EMAIL_API_KEY\n const defaultDomain = process.env.PAYLOAD_CLOUD_DEFAULT_DOMAIN\n if (pluginOptions?.email !== false && apiKey && defaultDomain) {\n config.email = await payloadCloudEmail({\n apiKey,\n config,\n defaultDomain,\n defaultFromAddress: pluginOptions?.email?.defaultFromAddress,\n defaultFromName: pluginOptions?.email?.defaultFromName,\n skipVerify: pluginOptions?.email?.skipVerify,\n })\n }\n\n return config\n }\n"],"names":["payloadCloudEmail","getAfterDeleteHook","getBeforeChangeHook","getCacheUploadsAfterChangeHook","getCacheUploadsAfterDeleteHook","getStaticHandler","payloadCloudPlugin","pluginOptions","incomingConfig","config","process","env","PAYLOAD_CLOUD","cachingEnabled","uploadCaching","PAYLOAD_CLOUD_CACHE_KEY","apiEndpoint","endpoint","storage","collections","map","collection","upload","hooks","afterChange","afterDelete","beforeChange","disableLocalStorage","handlers","Array","isArray","cachingOptions","useTempFi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AAgB,EAAE;oCACxCxB,oBAAoB;wCAAEmB;oCAAW;iCAClC;4BACH;4BACAC,QAAQ;gCACN,GAAI,OAAOD,WAAWC,MAAM,KAAK,WAAWD,WAAWC,MAAM,GAAG,CAAC,CAAC;gCAClEK,qBAAqB;gCACrBC,UAAU;uCACJ,OAAOP,WAAWC,MAAM,KAAK,YACjCO,MAAMC,OAAO,CAACT,WAAWC,MAAM,CAACM,QAAQ,IACpCP,WAAWC,MAAM,CAACM,QAAQ,GAC1B,EAAE;oCACNvB,iBAAiB;wCACf0B,gBAAgBxB,eAAeO;wCAC/BO;oCACF;iCACD;4BACH;wBACF;oBACF;oBAEA,OAAOA;gBACT;gBACAC,QAAQ;oBACN,GAAIb,OAAOa,MAAM,IAAI,CAAC,CAAC;oBACvBU,cAAc;gBAChB;YACF;QACF;QAEA,wBAAwB;QACxB,MAAMC,SAASvB,QAAQC,GAAG,CAACuB,2BAA2B;QACtD,MAAMC,gBAAgBzB,QAAQC,GAAG,CAACyB,4BAA4B;QAC9D,IAAI7B,eAAe8B,UAAU,SAASJ,UAAUE,eAAe;YAC7D1B,OAAO4B,KAAK,GAAG,MAAMrC,kBAAkB;gBACrCiC;gBACAxB;gBACA0B;gBACAG,oBAAoB/B,eAAe8B,OAAOC;gBAC1CC,iBAAiBhC,eAAe8B,OAAOE;gBACvCC,YAAYjC,eAAe8B,OAAOG;YACpC;QACF;QAEA,OAAO/B;IACT,EAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -40,55 +40,7 @@ export interface PayloadCloudEmailOptions {
|
|
|
40
40
|
defaultFromName?: string;
|
|
41
41
|
skipVerify?: boolean;
|
|
42
42
|
}
|
|
43
|
-
export type CronConfig = {
|
|
44
|
-
/**
|
|
45
|
-
* The cron schedule for the job.
|
|
46
|
-
* @default '* * * * *' (every minute).
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ┌───────────── minute (0 - 59)
|
|
50
|
-
* │ ┌───────────── hour (0 - 23)
|
|
51
|
-
* │ │ ┌───────────── day of the month (1 - 31)
|
|
52
|
-
* │ │ │ ┌───────────── month (1 - 12)
|
|
53
|
-
* │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
|
|
54
|
-
* │ │ │ │ │
|
|
55
|
-
* │ │ │ │ │
|
|
56
|
-
* - '0 * * * *' every hour at minute 0
|
|
57
|
-
* - '0 0 * * *' daily at midnight
|
|
58
|
-
* - '0 0 * * 0' weekly at midnight on Sundays
|
|
59
|
-
* - '0 0 1 * *' monthly at midnight on the 1st day of the month
|
|
60
|
-
* - '0/5 * * * *' every 5 minutes
|
|
61
|
-
*/
|
|
62
|
-
cron?: string;
|
|
63
|
-
/**
|
|
64
|
-
* The limit for the job. This can be overridden by the user. Defaults to 10.
|
|
65
|
-
*/
|
|
66
|
-
limit?: number;
|
|
67
|
-
/**
|
|
68
|
-
* The queue name for the job.
|
|
69
|
-
*/
|
|
70
|
-
queue?: string;
|
|
71
|
-
};
|
|
72
43
|
export interface PluginOptions {
|
|
73
|
-
/**
|
|
74
|
-
* Jobs configuration. By default, there is a single
|
|
75
|
-
* cron job that runs every minute.
|
|
76
|
-
*/
|
|
77
|
-
cronJobs?: {
|
|
78
|
-
/**
|
|
79
|
-
* Enable the cron jobs defined in the `run` array,
|
|
80
|
-
* or the default cron job if `run` is not defined.
|
|
81
|
-
* @default true
|
|
82
|
-
* @note If you change this in a development environment,
|
|
83
|
-
* you will need to restart the server for the changes to take effect.
|
|
84
|
-
*/
|
|
85
|
-
enabled?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Cron jobs configuration. If not defined, a single
|
|
88
|
-
* cron job is created that runs every minute.
|
|
89
|
-
*/
|
|
90
|
-
run?: CronConfig[];
|
|
91
|
-
};
|
|
92
44
|
/** Payload Cloud Email
|
|
93
45
|
* @default true
|
|
94
46
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":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KAChB,GACD,KAAK,CAAA;CACV;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n CollectionConfig,\n Config,\n FileData,\n PayloadRequest,\n TypeWithID,\n UploadCollectionSlug,\n} from 'payload'\n\nexport interface File {\n buffer: Buffer\n filename: string\n filesize: number\n mimeType: string\n tempFilePath?: string\n}\n\nexport type HandleUpload = (args: {\n collection: CollectionConfig\n data: any\n file: File\n req: PayloadRequest\n}) => Promise<void> | void\n\nexport interface TypeWithPrefix {\n prefix?: string\n}\n\nexport type HandleDelete = (args: {\n collection: CollectionConfig\n doc: FileData & TypeWithID & TypeWithPrefix\n filename: string\n req: PayloadRequest\n}) => Promise<void> | void\n\nexport type GenerateURL = (args: {\n collection: CollectionConfig\n filename: string\n prefix?: string\n}) => Promise<string> | string\n\nexport type StaticHandler = (\n req: PayloadRequest,\n args: { params: { collection: string; filename: string } },\n) => Promise<Response> | Promise<void> | Response | void\n\nexport interface PayloadCloudEmailOptions {\n apiKey: string\n config: Config\n defaultDomain: string\n defaultFromAddress?: string\n defaultFromName?: string\n skipVerify?: boolean\n}\n\nexport
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n CollectionConfig,\n Config,\n FileData,\n PayloadRequest,\n TypeWithID,\n UploadCollectionSlug,\n} from 'payload'\n\nexport interface File {\n buffer: Buffer\n filename: string\n filesize: number\n mimeType: string\n tempFilePath?: string\n}\n\nexport type HandleUpload = (args: {\n collection: CollectionConfig\n data: any\n file: File\n req: PayloadRequest\n}) => Promise<void> | void\n\nexport interface TypeWithPrefix {\n prefix?: string\n}\n\nexport type HandleDelete = (args: {\n collection: CollectionConfig\n doc: FileData & TypeWithID & TypeWithPrefix\n filename: string\n req: PayloadRequest\n}) => Promise<void> | void\n\nexport type GenerateURL = (args: {\n collection: CollectionConfig\n filename: string\n prefix?: string\n}) => Promise<string> | string\n\nexport type StaticHandler = (\n req: PayloadRequest,\n args: { params: { collection: string; filename: string } },\n) => Promise<Response> | Promise<void> | Response | void\n\nexport interface PayloadCloudEmailOptions {\n apiKey: string\n config: Config\n defaultDomain: string\n defaultFromAddress?: string\n defaultFromName?: string\n skipVerify?: boolean\n}\n\nexport interface PluginOptions {\n /** Payload Cloud Email\n * @default true\n */\n email?:\n | {\n defaultFromAddress: string\n defaultFromName: string\n skipVerify?: boolean\n }\n | false\n\n /**\n * Payload Cloud API endpoint\n *\n * @internal Endpoint override for developement\n */\n endpoint?: string\n\n /** Payload Cloud Storage\n * @default true\n */\n storage?: false\n\n /**\n * Upload caching. Defaults to 24 hours for all collections.\n *\n * Optionally configure caching per collection\n *\n * ```ts\n * {\n * collSlug1: {\n * maxAge: 3600 // Custom value in seconds\n * },\n * collSlug2: {\n * enabled: false // Disable caching for this collection\n * }\n * }\n * ```\n *\n * @default true\n */\n\n uploadCaching?:\n | {\n /**\n * Caching configuration per-collection\n */\n collections?: Partial<Record<UploadCollectionSlug, CollectionCachingConfig>>\n /** Caching in seconds override for all collections\n * @default 86400 (24 hours)\n */\n maxAge?: number\n }\n | false\n}\n\nexport type CollectionCachingConfig = {\n /**\n * Enable/disable caching for this collection\n *\n * @default true\n */\n enabled?: boolean\n /** Caching in seconds override for this collection\n * @default 86400 (24 hours)\n */\n maxAge?: number\n}\n"],"names":[],"mappings":"AAgHA,WAWC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/payload-cloud",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "The official Payload Cloud plugin",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -38,17 +38,16 @@
|
|
|
38
38
|
"amazon-cognito-identity-js": "^6.1.2",
|
|
39
39
|
"nodemailer": "6.9.10",
|
|
40
40
|
"resend": "^0.17.2",
|
|
41
|
-
"@payloadcms/email-nodemailer": "3.
|
|
41
|
+
"@payloadcms/email-nodemailer": "3.15.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/jest": "29.5.12",
|
|
45
45
|
"@types/nodemailer": "6.4.14",
|
|
46
46
|
"ts-jest": "^29.1.0",
|
|
47
|
-
"payload": "3.
|
|
47
|
+
"payload": "3.15.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"
|
|
51
|
-
"payload": "3.14.1-canary.f9e1e85"
|
|
50
|
+
"payload": "3.15.0"
|
|
52
51
|
},
|
|
53
52
|
"scripts": {
|
|
54
53
|
"build": "pnpm build:types && pnpm build:swc",
|