@maas/payload-plugin-media-cloud 0.0.11 → 0.0.15

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.
Files changed (40) hide show
  1. package/dist/adapter/handleDelete.mjs +3 -3
  2. package/dist/adapter/handleDelete.mjs.map +1 -1
  3. package/dist/collections/mediaCollection.mjs +9 -5
  4. package/dist/collections/mediaCollection.mjs.map +1 -1
  5. package/dist/components/upload-handler/upload-handler.mjs +13 -13
  6. package/dist/components/upload-handler/upload-handler.mjs.map +1 -1
  7. package/dist/components/upload-manager/upload-manager.mjs +2 -2
  8. package/dist/components/upload-manager/upload-manager.mjs.map +1 -1
  9. package/dist/endpoints/muxAssetHandler.d.mts +1 -1
  10. package/dist/endpoints/muxCreateUploadHandler.d.mts +1 -1
  11. package/dist/endpoints/muxCreateUploadHandler.mjs +1 -1
  12. package/dist/endpoints/muxCreateUploadHandler.mjs.map +1 -1
  13. package/dist/endpoints/muxWebhookHandler.d.mts +1 -1
  14. package/dist/endpoints/muxWebhookHandler.mjs +13 -3
  15. package/dist/endpoints/muxWebhookHandler.mjs.map +1 -1
  16. package/dist/endpoints/tusPostProcessorHandler.mjs +1 -1
  17. package/dist/endpoints/tusPostProcessorHandler.mjs.map +1 -1
  18. package/dist/error-handler/dist/index.mjs +84 -64
  19. package/dist/error-handler/dist/index.mjs.map +1 -1
  20. package/dist/hooks/useErrorHandler.d.mts +2 -178
  21. package/dist/hooks/useErrorHandler.mjs +4 -9
  22. package/dist/hooks/useErrorHandler.mjs.map +1 -1
  23. package/dist/plugin.d.mts +2 -3
  24. package/dist/plugin.mjs +28 -20
  25. package/dist/plugin.mjs.map +1 -1
  26. package/dist/tus/stores/s3/parts-manager.mjs +1 -1
  27. package/dist/tus/stores/s3/parts-manager.mjs.map +1 -1
  28. package/dist/types/errors.d.mts +20 -44
  29. package/dist/types/errors.mjs +21 -16
  30. package/dist/types/errors.mjs.map +1 -1
  31. package/dist/types/index.d.mts +4 -0
  32. package/dist/utils/file.mjs +2 -2
  33. package/dist/utils/file.mjs.map +1 -1
  34. package/dist/utils/mux.d.mts +5 -5
  35. package/dist/utils/mux.mjs +1 -1
  36. package/dist/utils/mux.mjs.map +1 -1
  37. package/dist/utils/tus.d.mts +2 -2
  38. package/dist/utils/tus.mjs +1 -1
  39. package/dist/utils/tus.mjs.map +1 -1
  40. package/package.json +15 -15
@@ -1,79 +1,99 @@
1
1
  //#region ../error-handler/dist/index.mjs
2
2
  /**
3
- * Creates a logger with configurable prefix, levels, and error/log sets
4
- * @param config - Configuration object containing prefix, level, error set, and log set
5
- * @returns Object with logError, throwError, and log functions
3
+ * @class MagicError
4
+ * @extends Error
5
+ * @description A custom error class that includes an error code, timestamp, and source.
6
+ *
7
+ * @property {string | number} errorCode - The error code.
8
+ * @property {number} timestamp - The timestamp when the error occurred.
9
+ * @property {string} source - The source of the error.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * throw new MagicError('An error occurred', 500, 'My-Component')
14
+ * ```
6
15
  */
7
- function createLogger(config) {
8
- const { prefix, level, errors = {}, logs = {} } = config;
9
- const logEntriesSet = new Set(Object.values(logs));
10
- const errorEntryKeyMap = /* @__PURE__ */ new Map();
11
- Object.entries(errors).forEach(([key, errorEntry]) => {
12
- errorEntryKeyMap.set(errorEntry, key);
13
- });
14
- class BaseError extends Error {
15
- constructor({ message, key, errorCode }) {
16
- super(`[${prefix}] ${message}`);
17
- this.name = "BaseError";
18
- this.key = key;
19
- this.errorCode = errorCode;
20
- }
16
+ var MagicError = class MagicError$1 extends Error {
17
+ /**
18
+ * @constructor
19
+ * @param {string} message - The error message.
20
+ * @param {string | number} errorCode - The error code.
21
+ * @param {string} source - The source of the error.
22
+ * @param {ErrorOptions} [options] - The error options.
23
+ */
24
+ constructor(message, errorCode, source, options) {
25
+ super(message, options);
26
+ this.name = "MagicError";
27
+ this.errorCode = errorCode;
28
+ this.timestamp = Date.now();
29
+ this.source = source;
30
+ if (Error.captureStackTrace) Error.captureStackTrace(this, MagicError$1);
21
31
  }
22
- function formatMessage(message) {
23
- return `[${prefix}] ${message}`;
32
+ };
33
+ /**
34
+ * @function useMagicError
35
+ * @description A hook to create a `MagicError` instance and throw it.
36
+ * @param {UseMagicErrorArgs} [args] - The arguments for the hook.
37
+ * @returns {UseMagicErrorReturn} - The return value of the hook.
38
+ */
39
+ function useMagicError(args = {}) {
40
+ const { prefix = "MagicError", source = "payload-plugins" } = args;
41
+ /**
42
+ * @function log
43
+ * @description Logs a message to the console.
44
+ * @param {string} message - The message to log.
45
+ */
46
+ function log(message) {
47
+ console.log(`[${prefix}]:`, message);
24
48
  }
25
- function logError(errorEntry, overrideLevel) {
26
- if (!errorEntry) {
27
- console.error(`[${prefix}] Invalid error entry provided`);
28
- return;
29
- }
30
- const formattedMessage = formatMessage(errorEntry.message);
31
- switch (overrideLevel ?? level) {
32
- case "WARNING":
33
- console.warn(formattedMessage);
34
- break;
35
- case "ERROR":
36
- console.error(formattedMessage);
37
- break;
38
- default: console.error(formattedMessage);
39
- }
49
+ /**
50
+ * @function logError
51
+ * @description Logs an error message to the console.
52
+ * @param {string} message - The message to log.
53
+ */
54
+ function logError(message) {
55
+ console.error(`[${prefix}]:`, message);
40
56
  }
41
- function log(logEntry) {
42
- if (!logEntry || !logEntriesSet.has(logEntry)) {
43
- console.error(`[${prefix}] Invalid log entry provided`);
44
- return;
45
- }
46
- const formattedMessage = formatMessage(logEntry.message);
47
- console.log(formattedMessage);
57
+ /**
58
+ * @function logWarning
59
+ * @description Logs a warning message to the console.
60
+ * @param {string} message - The message to log.
61
+ */
62
+ function logWarning(message) {
63
+ console.warn(`[${prefix}]:`, message);
48
64
  }
49
- function throwError(errorEntry) {
50
- if (!errorEntry) throw new BaseError({
51
- key: "UNKNOWN_ERROR",
52
- message: "Invalid error entry provided",
53
- errorCode: 500
54
- });
55
- const errorCode = errorEntry.errorCode ?? 500;
56
- throw new BaseError({
57
- key: errorEntryKeyMap.get(errorEntry) || "UNKNOWN_ERROR",
58
- message: errorEntry.message,
59
- errorCode
60
- });
65
+ /**
66
+ * @function throwError
67
+ * @description Throws a `MagicError`.
68
+ * @param {ThrowErrorArgs} args - The arguments for the error.
69
+ * @throws {MagicError}
70
+ */
71
+ function throwError(args$1) {
72
+ const { message, errorCode, cause } = args$1;
73
+ const error = new MagicError(`[${prefix}]: ${message}`, errorCode, source, { cause });
74
+ logError(message);
75
+ throw error;
76
+ }
77
+ /**
78
+ * @function assert
79
+ * @description Asserts that a value is not null or undefined.
80
+ * @param {T} value - The value to assert.
81
+ * @param {ThrowErrorArgs} args - The arguments for the error to throw if the assertion fails.
82
+ * @throws {MagicError}
83
+ */
84
+ function assert(value, args$1) {
85
+ if (value === void 0 || value === null) throwError(args$1);
61
86
  }
62
87
  return {
63
- logError,
88
+ assert,
64
89
  throwError,
65
- log
90
+ log,
91
+ logError,
92
+ logWarning,
93
+ MagicError
66
94
  };
67
95
  }
68
- /**
69
- * Log level enum for categorizing log/error severity
70
- */
71
- let LogLevel = /* @__PURE__ */ function(LogLevel$1) {
72
- LogLevel$1["WARNING"] = "WARNING";
73
- LogLevel$1["ERROR"] = "ERROR";
74
- return LogLevel$1;
75
- }({});
76
96
 
77
97
  //#endregion
78
- export { LogLevel, createLogger };
98
+ export { useMagicError };
79
99
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../error-handler/dist/index.mjs"],"sourcesContent":["//#region src/createLogger.ts\n/**\n* Creates a logger with configurable prefix, levels, and error/log sets\n* @param config - Configuration object containing prefix, level, error set, and log set\n* @returns Object with logError, throwError, and log functions\n*/\nfunction createLogger(config) {\n\tconst { prefix, level, errors = {}, logs = {} } = config;\n\tconst logEntriesSet = new Set(Object.values(logs));\n\tconst errorEntryKeyMap = /* @__PURE__ */ new Map();\n\tObject.entries(errors).forEach(([key, errorEntry]) => {\n\t\terrorEntryKeyMap.set(errorEntry, key);\n\t});\n\tclass BaseError extends Error {\n\t\tconstructor({ message, key, errorCode }) {\n\t\t\tsuper(`[${prefix}] ${message}`);\n\t\t\tthis.name = \"BaseError\";\n\t\t\tthis.key = key;\n\t\t\tthis.errorCode = errorCode;\n\t\t}\n\t}\n\tfunction formatMessage(message) {\n\t\treturn `[${prefix}] ${message}`;\n\t}\n\tfunction logError(errorEntry, overrideLevel) {\n\t\tif (!errorEntry) {\n\t\t\tconsole.error(`[${prefix}] Invalid error entry provided`);\n\t\t\treturn;\n\t\t}\n\t\tconst formattedMessage = formatMessage(errorEntry.message);\n\t\tswitch (overrideLevel ?? level) {\n\t\t\tcase \"WARNING\":\n\t\t\t\tconsole.warn(formattedMessage);\n\t\t\t\tbreak;\n\t\t\tcase \"ERROR\":\n\t\t\t\tconsole.error(formattedMessage);\n\t\t\t\tbreak;\n\t\t\tdefault: console.error(formattedMessage);\n\t\t}\n\t}\n\tfunction log(logEntry) {\n\t\tif (!logEntry || !logEntriesSet.has(logEntry)) {\n\t\t\tconsole.error(`[${prefix}] Invalid log entry provided`);\n\t\t\treturn;\n\t\t}\n\t\tconst formattedMessage = formatMessage(logEntry.message);\n\t\tconsole.log(formattedMessage);\n\t}\n\tfunction throwError(errorEntry) {\n\t\tif (!errorEntry) throw new BaseError({\n\t\t\tkey: \"UNKNOWN_ERROR\",\n\t\t\tmessage: \"Invalid error entry provided\",\n\t\t\terrorCode: 500\n\t\t});\n\t\tconst errorCode = errorEntry.errorCode ?? 500;\n\t\tthrow new BaseError({\n\t\t\tkey: errorEntryKeyMap.get(errorEntry) || \"UNKNOWN_ERROR\",\n\t\t\tmessage: errorEntry.message,\n\t\t\terrorCode\n\t\t});\n\t}\n\treturn {\n\t\tlogError,\n\t\tthrowError,\n\t\tlog\n\t};\n}\n\n//#endregion\n//#region src/types.ts\n/**\n* Log level enum for categorizing log/error severity\n*/\nlet LogLevel = /* @__PURE__ */ function(LogLevel$1) {\n\tLogLevel$1[\"WARNING\"] = \"WARNING\";\n\tLogLevel$1[\"ERROR\"] = \"ERROR\";\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IAAI,UAAU;GACnB,KAAK,iBAAiB,IAAI,WAAW,IAAI;GACzC,SAAS,WAAW;GACpB;GACA,CAAC;;AAEH,QAAO;EACN;EACA;EACA;EACA;;;;;AAQF,IAAI,WAA2B,yBAAS,YAAY;AACnD,YAAW,aAAa;AACxB,YAAW,WAAW;AACtB,QAAO;EACN,EAAE,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["MagicError"],"sources":["../../../../error-handler/dist/index.mjs"],"sourcesContent":["//#region src/class/MagicError.ts\n/**\n* @class MagicError\n* @extends Error\n* @description A custom error class that includes an error code, timestamp, and source.\n*\n* @property {string | number} errorCode - The error code.\n* @property {number} timestamp - The timestamp when the error occurred.\n* @property {string} source - The source of the error.\n*\n* @example\n* ```ts\n* throw new MagicError('An error occurred', 500, 'My-Component')\n* ```\n*/\nvar MagicError = class MagicError extends Error {\n\t/**\n\t* @constructor\n\t* @param {string} message - The error message.\n\t* @param {string | number} errorCode - The error code.\n\t* @param {string} source - The source of the error.\n\t* @param {ErrorOptions} [options] - The error options.\n\t*/\n\tconstructor(message, errorCode, source, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"MagicError\";\n\t\tthis.errorCode = errorCode;\n\t\tthis.timestamp = Date.now();\n\t\tthis.source = source;\n\t\tif (Error.captureStackTrace) Error.captureStackTrace(this, MagicError);\n\t}\n};\n\n//#endregion\n//#region src/hooks/useMagicError.ts\n/**\n* @function useMagicError\n* @description A hook to create a `MagicError` instance and throw it.\n* @param {UseMagicErrorArgs} [args] - The arguments for the hook.\n* @returns {UseMagicErrorReturn} - The return value of the hook.\n*/\nfunction useMagicError(args = {}) {\n\tconst { prefix = \"MagicError\", source = \"payload-plugins\" } = args;\n\t/**\n\t* @function log\n\t* @description Logs a message to the console.\n\t* @param {string} message - The message to log.\n\t*/\n\tfunction log(message) {\n\t\tconsole.log(`[${prefix}]:`, message);\n\t}\n\t/**\n\t* @function logError\n\t* @description Logs an error message to the console.\n\t* @param {string} message - The message to log.\n\t*/\n\tfunction logError(message) {\n\t\tconsole.error(`[${prefix}]:`, message);\n\t}\n\t/**\n\t* @function logWarning\n\t* @description Logs a warning message to the console.\n\t* @param {string} message - The message to log.\n\t*/\n\tfunction logWarning(message) {\n\t\tconsole.warn(`[${prefix}]:`, message);\n\t}\n\t/**\n\t* @function throwError\n\t* @description Throws a `MagicError`.\n\t* @param {ThrowErrorArgs} args - The arguments for the error.\n\t* @throws {MagicError}\n\t*/\n\tfunction throwError(args$1) {\n\t\tconst { message, errorCode, cause } = args$1;\n\t\tconst error = new MagicError(`[${prefix}]: ${message}`, errorCode, source, { cause });\n\t\tlogError(message);\n\t\tthrow error;\n\t}\n\t/**\n\t* @function assert\n\t* @description Asserts that a value is not null or undefined.\n\t* @param {T} value - The value to assert.\n\t* @param {ThrowErrorArgs} args - The arguments for the error to throw if the assertion fails.\n\t* @throws {MagicError}\n\t*/\n\tfunction assert(value, args$1) {\n\t\tif (value === void 0 || value === null) throwError(args$1);\n\t}\n\treturn {\n\t\tassert,\n\t\tthrowError,\n\t\tlog,\n\t\tlogError,\n\t\tlogWarning,\n\t\tMagicError\n\t};\n}\n\n//#endregion\nexport { MagicError, useMagicError };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAI,aAAa,MAAMA,qBAAmB,MAAM;;;;;;;;CAQ/C,YAAY,SAAS,WAAW,QAAQ,SAAS;AAChD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;AACZ,OAAK,YAAY;AACjB,OAAK,YAAY,KAAK,KAAK;AAC3B,OAAK,SAAS;AACd,MAAI,MAAM,kBAAmB,OAAM,kBAAkB,MAAMA,aAAW;;;;;;;;;AAYxE,SAAS,cAAc,OAAO,EAAE,EAAE;CACjC,MAAM,EAAE,SAAS,cAAc,SAAS,sBAAsB;;;;;;CAM9D,SAAS,IAAI,SAAS;AACrB,UAAQ,IAAI,IAAI,OAAO,KAAK,QAAQ;;;;;;;CAOrC,SAAS,SAAS,SAAS;AAC1B,UAAQ,MAAM,IAAI,OAAO,KAAK,QAAQ;;;;;;;CAOvC,SAAS,WAAW,SAAS;AAC5B,UAAQ,KAAK,IAAI,OAAO,KAAK,QAAQ;;;;;;;;CAQtC,SAAS,WAAW,QAAQ;EAC3B,MAAM,EAAE,SAAS,WAAW,UAAU;EACtC,MAAM,QAAQ,IAAI,WAAW,IAAI,OAAO,KAAK,WAAW,WAAW,QAAQ,EAAE,OAAO,CAAC;AACrF,WAAS,QAAQ;AACjB,QAAM;;;;;;;;;CASP,SAAS,OAAO,OAAO,QAAQ;AAC9B,MAAI,UAAU,KAAK,KAAK,UAAU,KAAM,YAAW,OAAO;;AAE3D,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA"}
@@ -1,183 +1,7 @@
1
- import { LogLevel } from "@maas/error-handler";
1
+ import { UseMagicErrorReturn } from "@maas/error-handler";
2
2
 
3
3
  //#region src/hooks/useErrorHandler.d.ts
4
- declare function useErrorHandler(): {
5
- logError: (errorEntry: {
6
- readonly message: "Mux configuration (tokenId and tokenSecret) must be provided in pluginOptions to use Mux";
7
- readonly errorCode: 400;
8
- } | {
9
- readonly message: "Mux configuration is missing. Mux features will not be available";
10
- readonly errorCode: 400;
11
- } | {
12
- readonly message: "No upload-id found for upload";
13
- readonly errorCode: 400;
14
- } | {
15
- readonly message: "Error deleting Mux asset";
16
- readonly errorCode: 500;
17
- } | {
18
- readonly message: "Mux video upload failed";
19
- readonly errorCode: 500;
20
- } | {
21
- readonly message: "Mux direct upload failed";
22
- readonly errorCode: 500;
23
- } | {
24
- readonly message: "Error in Mux create upload handler";
25
- readonly errorCode: 500;
26
- } | {
27
- readonly message: "Request does not support json() method";
28
- readonly errorCode: 400;
29
- } | {
30
- readonly message: "S3 configuration (bucket, region, accessKeyId, secretAccessKey) must be provided in pluginOptions";
31
- readonly errorCode: 400;
32
- } | {
33
- readonly message: "Error deleting file from S3";
34
- readonly errorCode: 500;
35
- } | {
36
- readonly message: "Could not find a unique file name after maximum tries";
37
- readonly errorCode: 500;
38
- } | {
39
- readonly message: "TUS file upload error occurred";
40
- readonly errorCode: 500;
41
- } | {
42
- readonly message: "Unknown storage type for media";
43
- readonly errorCode: 500;
44
- } | {
45
- readonly message: "Unable to determine file type";
46
- readonly errorCode: 400;
47
- } | {
48
- readonly message: "Error determining file type";
49
- readonly errorCode: 500;
50
- } | {
51
- readonly message: "Error sanitizing filename";
52
- readonly errorCode: 500;
53
- } | {
54
- readonly message: "Filename is missing, cannot parse file";
55
- readonly errorCode: 500;
56
- } | {
57
- readonly message: "File not found";
58
- readonly errorCode: 404;
59
- } | {
60
- readonly message: "Error setting media dimensions";
61
- readonly errorCode: 500;
62
- } | {
63
- readonly message: "No upload URL provided, cannot parse upload ID";
64
- readonly errorCode: 400;
65
- } | {
66
- readonly message: "Upload handler error occurred";
67
- readonly errorCode: 500;
68
- } | {
69
- readonly message: "Polling error for upload";
70
- readonly errorCode: 500;
71
- } | {
72
- readonly message: "Payload Media Cloud plugin is not configured";
73
- readonly errorCode: 500;
74
- } | {
75
- readonly message: "Error in namingFunction";
76
- readonly errorCode: 500;
77
- }, overrideLevel?: LogLevel) => void;
78
- throwError: (errorEntry: {
79
- readonly message: "Mux configuration (tokenId and tokenSecret) must be provided in pluginOptions to use Mux";
80
- readonly errorCode: 400;
81
- } | {
82
- readonly message: "Mux configuration is missing. Mux features will not be available";
83
- readonly errorCode: 400;
84
- } | {
85
- readonly message: "No upload-id found for upload";
86
- readonly errorCode: 400;
87
- } | {
88
- readonly message: "Error deleting Mux asset";
89
- readonly errorCode: 500;
90
- } | {
91
- readonly message: "Mux video upload failed";
92
- readonly errorCode: 500;
93
- } | {
94
- readonly message: "Mux direct upload failed";
95
- readonly errorCode: 500;
96
- } | {
97
- readonly message: "Error in Mux create upload handler";
98
- readonly errorCode: 500;
99
- } | {
100
- readonly message: "Request does not support json() method";
101
- readonly errorCode: 400;
102
- } | {
103
- readonly message: "S3 configuration (bucket, region, accessKeyId, secretAccessKey) must be provided in pluginOptions";
104
- readonly errorCode: 400;
105
- } | {
106
- readonly message: "Error deleting file from S3";
107
- readonly errorCode: 500;
108
- } | {
109
- readonly message: "Could not find a unique file name after maximum tries";
110
- readonly errorCode: 500;
111
- } | {
112
- readonly message: "TUS file upload error occurred";
113
- readonly errorCode: 500;
114
- } | {
115
- readonly message: "Unknown storage type for media";
116
- readonly errorCode: 500;
117
- } | {
118
- readonly message: "Unable to determine file type";
119
- readonly errorCode: 400;
120
- } | {
121
- readonly message: "Error determining file type";
122
- readonly errorCode: 500;
123
- } | {
124
- readonly message: "Error sanitizing filename";
125
- readonly errorCode: 500;
126
- } | {
127
- readonly message: "Filename is missing, cannot parse file";
128
- readonly errorCode: 500;
129
- } | {
130
- readonly message: "File not found";
131
- readonly errorCode: 404;
132
- } | {
133
- readonly message: "Error setting media dimensions";
134
- readonly errorCode: 500;
135
- } | {
136
- readonly message: "No upload URL provided, cannot parse upload ID";
137
- readonly errorCode: 400;
138
- } | {
139
- readonly message: "Upload handler error occurred";
140
- readonly errorCode: 500;
141
- } | {
142
- readonly message: "Polling error for upload";
143
- readonly errorCode: 500;
144
- } | {
145
- readonly message: "Payload Media Cloud plugin is not configured";
146
- readonly errorCode: 500;
147
- } | {
148
- readonly message: "Error in namingFunction";
149
- readonly errorCode: 500;
150
- }) => never;
151
- log: (logEntry: {
152
- readonly message: "Initializing multipart upload";
153
- } | {
154
- readonly message: "Multipart upload created";
155
- } | {
156
- readonly message: "Failed to finish upload";
157
- } | {
158
- readonly message: "Attempting to read file from S3";
159
- } | {
160
- readonly message: "Successfully read file from S3";
161
- } | {
162
- readonly message: "Failed to read file, trying again";
163
- } | {
164
- readonly message: "Failed to read file";
165
- } | {
166
- readonly message: "No file found";
167
- } | {
168
- readonly message: "Error retrieving parts";
169
- } | {
170
- readonly message: "Saving metadata";
171
- } | {
172
- readonly message: "Metadata file saved";
173
- } | {
174
- readonly message: "Removing cached data";
175
- } | {
176
- readonly message: "Finished uploading incomplete part";
177
- } | {
178
- readonly message: "Failed to remove chunk";
179
- }) => void;
180
- };
4
+ declare function useErrorHandler(): Omit<UseMagicErrorReturn, 'assert' | 'MagicError'>;
181
5
  //#endregion
182
6
  export { useErrorHandler };
183
7
  //# sourceMappingURL=useErrorHandler.d.mts.map
@@ -1,18 +1,13 @@
1
- import { MediaCloudErrors, MediaCloudLogs } from "../types/errors.mjs";
2
- import { LogLevel, createLogger } from "../error-handler/dist/index.mjs";
1
+ import { useMagicError } from "../error-handler/dist/index.mjs";
3
2
 
4
3
  //#region src/hooks/useErrorHandler.ts
5
4
  function useErrorHandler() {
6
- const { logError, throwError, log } = createLogger({
7
- prefix: "PLUGIN-MEDIA-CLOUD",
8
- level: LogLevel.ERROR,
9
- errors: MediaCloudErrors,
10
- logs: MediaCloudLogs
11
- });
5
+ const { log, logError, throwError, logWarning } = useMagicError({ prefix: "PLUGIN-MEDIA-CLOUD" });
12
6
  return {
7
+ log,
13
8
  logError,
14
9
  throwError,
15
- log
10
+ logWarning
16
11
  };
17
12
  }
18
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"useErrorHandler.mjs","names":[],"sources":["../../src/hooks/useErrorHandler.ts"],"sourcesContent":["import { createLogger, LogLevel } from '@maas/error-handler'\nimport { MediaCloudErrors, MediaCloudLogs } from '../types/errors'\n\nexport function useErrorHandler() {\n const { logError, throwError, log } = createLogger({\n prefix: 'PLUGIN-MEDIA-CLOUD',\n level: LogLevel.ERROR,\n errors: MediaCloudErrors,\n logs: MediaCloudLogs,\n })\n\n return {\n logError,\n throwError,\n log,\n }\n}\n"],"mappings":";;;;AAGA,SAAgB,kBAAkB;CAChC,MAAM,EAAE,UAAU,YAAY,QAAQ,aAAa;EACjD,QAAQ;EACR,OAAO,SAAS;EAChB,QAAQ;EACR,MAAM;EACP,CAAC;AAEF,QAAO;EACL;EACA;EACA;EACD"}
1
+ {"version":3,"file":"useErrorHandler.mjs","names":[],"sources":["../../src/hooks/useErrorHandler.ts"],"sourcesContent":["import { useMagicError, type UseMagicErrorReturn } from '@maas/error-handler'\n\nexport function useErrorHandler(): Omit<\n UseMagicErrorReturn,\n 'assert' | 'MagicError'\n> {\n const { log, logError, throwError, logWarning } = useMagicError({\n prefix: 'PLUGIN-MEDIA-CLOUD',\n })\n\n return {\n log,\n logError,\n throwError,\n logWarning,\n }\n}\n"],"mappings":";;;AAEA,SAAgB,kBAGd;CACA,MAAM,EAAE,KAAK,UAAU,YAAY,eAAe,cAAc,EAC9D,QAAQ,sBACT,CAAC;AAEF,QAAO;EACL;EACA;EACA;EACA;EACD"}
package/dist/plugin.d.mts CHANGED
@@ -5,9 +5,8 @@ import { Config } from "payload";
5
5
 
6
6
  /**
7
7
  * Media Cloud Plugin for Payload CMS
8
- * Provides file upload capabilities using S3 storage and Mux video processing
9
- * @param pluginOptions - Configuration options for the plugin
10
- * @returns A function that configures the Payload config
8
+ * @param pluginOptions Configuration options
9
+ * @returns Payload config function
11
10
  */
12
11
  declare function mediaCloudPlugin(pluginOptions: MediaCloudPluginOptions): (config: Config) => Config;
13
12
  //#endregion
package/dist/plugin.mjs CHANGED
@@ -2,32 +2,30 @@ import { MediaCloudErrors } from "./types/errors.mjs";
2
2
  import { useErrorHandler } from "./hooks/useErrorHandler.mjs";
3
3
  import { getStorageAdapter } from "./adapter/storageAdapter.mjs";
4
4
  import { getMediaCollection } from "./collections/mediaCollection.mjs";
5
- import { createTusEndpoints, createTusServer } from "./utils/tus.mjs";
6
5
  import { createS3Store } from "./tus/stores/s3/index.mjs";
7
6
  import { createMuxClient, createMuxEndpoints, validateMuxConfig } from "./utils/mux.mjs";
7
+ import { createTusEndpoints, createTusServer } from "./utils/tus.mjs";
8
8
  import { cloudStoragePlugin } from "@payloadcms/plugin-cloud-storage";
9
9
  import { initClientUploads } from "@payloadcms/plugin-cloud-storage/utilities";
10
- import deepmerge from "@fastify/deepmerge";
11
10
 
12
11
  //#region src/plugin.ts
13
12
  const { logError } = useErrorHandler();
14
13
  let muxClient = null;
15
14
  /**
16
15
  * Media Cloud Plugin for Payload CMS
17
- * Provides file upload capabilities using S3 storage and Mux video processing
18
- * @param pluginOptions - Configuration options for the plugin
19
- * @returns A function that configures the Payload config
16
+ * @param pluginOptions Configuration options
17
+ * @returns Payload config function
20
18
  */
21
19
  function mediaCloudPlugin(pluginOptions) {
22
20
  return function(config) {
23
21
  if (!pluginOptions) {
24
- logError(MediaCloudErrors.PLUGIN_NOT_CONFIGURED);
22
+ logError(MediaCloudErrors.PLUGIN_NOT_CONFIGURED.message);
25
23
  return config;
26
24
  }
27
25
  if (pluginOptions.enabled === false) return config;
28
26
  /**
29
- * Gets or creates a Mux client instance
30
- * @returns The Mux client instance
27
+ * Helper function to get or create Mux client instance
28
+ * @returns Mux client instance
31
29
  */
32
30
  function getMuxClient() {
33
31
  if (muxClient) return muxClient;
@@ -37,7 +35,7 @@ function mediaCloudPlugin(pluginOptions) {
37
35
  validateMuxConfig(pluginOptions.mux);
38
36
  muxClient = getMuxClient();
39
37
  } else {
40
- logError(MediaCloudErrors.MUX_CONFIG_INCOMPLETE);
38
+ logError(MediaCloudErrors.MUX_CONFIG_INCOMPLETE.message);
41
39
  muxClient = null;
42
40
  }
43
41
  const s3Store = createS3Store(pluginOptions.s3);
@@ -77,18 +75,28 @@ function mediaCloudPlugin(pluginOptions) {
77
75
  clientUploads: true,
78
76
  disableLocalStorage: true
79
77
  } } };
80
- const customConfig = {
81
- admin: { components: { providers: ["@maas/payload-plugin-media-cloud/components#UploadManagerProvider"] } },
82
- collections: [mediaCollection],
83
- endpoints: [...createTusEndpoints({
84
- tusServer,
85
- s3Store
86
- }), ...createMuxEndpoints({
87
- getMuxClient,
88
- pluginOptions
89
- })]
78
+ const mergedConfig = {
79
+ ...config,
80
+ admin: {
81
+ ...config.admin,
82
+ components: {
83
+ ...config.admin?.components,
84
+ providers: [...config.admin?.components?.providers ?? [], "@maas/payload-plugin-media-cloud/components#UploadManagerProvider"]
85
+ }
86
+ },
87
+ collections: [...config.collections ?? [], mediaCollection],
88
+ endpoints: [
89
+ ...config.endpoints ?? [],
90
+ ...createTusEndpoints({
91
+ tusServer,
92
+ s3Store
93
+ }),
94
+ ...createMuxEndpoints({
95
+ getMuxClient,
96
+ pluginOptions
97
+ })
98
+ ]
90
99
  };
91
- const mergedConfig = deepmerge({ all: true })(config, customConfig);
92
100
  return cloudStoragePlugin(cloudStorageConfig)(mergedConfig);
93
101
  };
94
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":["muxClient: Mux | null","mergedConfig: Config"],"sources":["../src/plugin.ts"],"sourcesContent":["import Mux from '@mux/mux-node'\n\nimport { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage'\nimport { initClientUploads } from '@payloadcms/plugin-cloud-storage/utilities'\n\nimport { MediaCloudErrors } from './types/errors'\nimport { useErrorHandler } from './hooks/useErrorHandler'\nimport { getStorageAdapter } from './adapter/storageAdapter'\nimport { getMediaCollection } from './collections/mediaCollection'\nimport { createTusServer, createTusEndpoints } from './utils/tus'\n\nimport { createS3Store } from './tus/stores/s3'\nimport {\n createMuxClient,\n validateMuxConfig,\n createMuxEndpoints,\n} from './utils/mux'\n\nimport type { Config } from 'payload'\nimport type { MediaCloudPluginOptions } from './types'\nimport deepmerge from '@fastify/deepmerge'\n\nconst { logError } = useErrorHandler()\n\nlet muxClient: Mux | null = null\n\n/**\n * Media Cloud Plugin for Payload CMS\n * Provides file upload capabilities using S3 storage and Mux video processing\n * @param pluginOptions - Configuration options for the plugin\n * @returns A function that configures the Payload config\n */\nexport function mediaCloudPlugin(pluginOptions: MediaCloudPluginOptions) {\n return function (config: Config): Config {\n // Check if the plugin is configured\n if (!pluginOptions) {\n logError(MediaCloudErrors.PLUGIN_NOT_CONFIGURED)\n return config\n }\n\n // Check if the plugin is disabled\n if (pluginOptions.enabled === false) {\n return config\n }\n\n /**\n * Gets or creates a Mux client instance\n * @returns The Mux client instance\n */\n function getMuxClient(): Mux {\n // Return existing Mux client if already created\n if (muxClient) {\n return muxClient\n }\n // Create and return a new Mux client\n return createMuxClient(pluginOptions.mux)\n }\n\n // Validate Mux configuration\n if (pluginOptions.mux) {\n validateMuxConfig(pluginOptions.mux)\n muxClient = getMuxClient()\n } else {\n logError(MediaCloudErrors.MUX_CONFIG_INCOMPLETE)\n muxClient = null\n }\n\n // Create S3 store and Tus server instances\n const s3Store = createS3Store(pluginOptions.s3)\n const tusServer = createTusServer({ config, s3Store, pluginOptions })\n\n // Extend base collection if specified\n const baseCollection = config.collections?.find(\n ({ slug }) => slug === pluginOptions.collection\n )\n\n // Create media collection with optional base configuration\n const mediaCollection = getMediaCollection({\n s3Store,\n baseCollection,\n })\n\n // Remove base collection if it was extended\n if (baseCollection) {\n config = {\n ...config,\n collections:\n config.collections?.filter(\n ({ slug }) => slug !== baseCollection?.slug\n ) || [],\n }\n }\n\n // Initialize client uploads\n initClientUploads({\n clientHandler:\n '@maas/payload-plugin-media-cloud/components#UploadHandler',\n collections: {\n media: {\n clientUploads: true,\n disableLocalStorage: true,\n },\n },\n config,\n enabled: true,\n serverHandler: () => {\n return Response.json(\n { message: 'Server handler is not implemented' },\n { status: 501 }\n )\n },\n serverHandlerPath: '/media-cloud/upload',\n })\n\n const cloudStorageConfig = {\n collections: {\n media: {\n adapter: getStorageAdapter({ getMuxClient, pluginOptions, s3Store }),\n clientUploads: true,\n disableLocalStorage: true,\n },\n },\n }\n\n const customConfig = {\n admin: {\n components: {\n providers: [\n '@maas/payload-plugin-media-cloud/components#UploadManagerProvider',\n ],\n },\n },\n collections: [mediaCollection],\n endpoints: [\n ...createTusEndpoints({ tusServer, s3Store }),\n ...createMuxEndpoints({ getMuxClient, pluginOptions }),\n ],\n }\n\n // Merge custom config with existing config\n const mergedConfig: Config = deepmerge({ all: true })(config, customConfig)\n\n return cloudStoragePlugin(cloudStorageConfig)(mergedConfig)\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,EAAE,aAAa,iBAAiB;AAEtC,IAAIA,YAAwB;;;;;;;AAQ5B,SAAgB,iBAAiB,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AuB,UAAU,EAAE,KAAK,MAAM,CAAC,CAAC,QAAQ,aAAa;AAE3E,SAAO,mBAAmB,mBAAmB,CAAC,aAAa"}
1
+ {"version":3,"file":"plugin.mjs","names":["muxClient: Mux | null","mergedConfig: Config"],"sources":["../src/plugin.ts"],"sourcesContent":["import Mux from '@mux/mux-node'\nimport { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage'\nimport { initClientUploads } from '@payloadcms/plugin-cloud-storage/utilities'\n\nimport { MediaCloudErrors } from './types/errors'\nimport { getStorageAdapter } from './adapter/storageAdapter'\nimport { getMediaCollection } from './collections/mediaCollection'\nimport { useErrorHandler } from './hooks/useErrorHandler'\nimport { createS3Store } from './tus/stores/s3'\nimport {\n createMuxClient,\n createMuxEndpoints,\n validateMuxConfig,\n} from './utils/mux'\nimport { createTusEndpoints, createTusServer } from './utils/tus'\n\nimport type { Config } from 'payload'\nimport type { MediaCloudPluginOptions } from './types'\n\nconst { logError } = useErrorHandler()\n\nlet muxClient: Mux | null = null\n\n/**\n * Media Cloud Plugin for Payload CMS\n * @param pluginOptions Configuration options\n * @returns Payload config function\n */\nexport function mediaCloudPlugin(pluginOptions: MediaCloudPluginOptions) {\n return function (config: Config): Config {\n // Early returns for invalid or disabled plugin configuration\n if (!pluginOptions) {\n logError(MediaCloudErrors.PLUGIN_NOT_CONFIGURED.message)\n return config\n }\n\n if (pluginOptions.enabled === false) {\n return config\n }\n\n /**\n * Helper function to get or create Mux client instance\n * @returns Mux client instance\n */\n function getMuxClient(): Mux {\n if (muxClient) {\n return muxClient\n }\n return createMuxClient(pluginOptions.mux)\n }\n\n // Initialize Mux client if configuration is provided\n if (pluginOptions.mux) {\n validateMuxConfig(pluginOptions.mux)\n muxClient = getMuxClient()\n } else {\n logError(MediaCloudErrors.MUX_CONFIG_INCOMPLETE.message)\n muxClient = null\n }\n\n const s3Store = createS3Store(pluginOptions.s3)\n const tusServer = createTusServer({ config, s3Store, pluginOptions })\n\n // Handle collection extension - replace base collection if it exists\n const baseCollection = config.collections?.find(\n ({ slug }) => slug === pluginOptions.collection\n )\n\n const mediaCollection = getMediaCollection({\n s3Store,\n baseCollection,\n })\n\n if (baseCollection) {\n config = {\n ...config,\n collections:\n config.collections?.filter(\n ({ slug }) => slug !== baseCollection?.slug\n ) || [],\n }\n }\n\n initClientUploads({\n clientHandler:\n '@maas/payload-plugin-media-cloud/components#UploadHandler',\n collections: {\n media: {\n clientUploads: true,\n disableLocalStorage: true,\n },\n },\n config,\n enabled: true,\n serverHandler: () => {\n return Response.json(\n { message: 'Server handler is not implemented' },\n { status: 501 }\n )\n },\n serverHandlerPath: '/media-cloud/upload',\n })\n\n const cloudStorageConfig = {\n collections: {\n media: {\n adapter: getStorageAdapter({ getMuxClient, pluginOptions, s3Store }),\n clientUploads: true,\n disableLocalStorage: true,\n },\n },\n }\n\n const mergedConfig: Config = {\n ...config,\n admin: {\n ...config.admin,\n components: {\n ...config.admin?.components,\n providers: [\n ...(config.admin?.components?.providers ?? []),\n '@maas/payload-plugin-media-cloud/components#UploadManagerProvider',\n ],\n },\n },\n collections: [...(config.collections ?? []), mediaCollection],\n endpoints: [\n ...(config.endpoints ?? []),\n ...createTusEndpoints({ tusServer, s3Store }),\n ...createMuxEndpoints({ getMuxClient, pluginOptions }),\n ],\n }\n\n return cloudStoragePlugin(cloudStorageConfig)(mergedConfig)\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBA,MAAM,EAAE,aAAa,iBAAiB;AAEtC,IAAIA,YAAwB;;;;;;AAO5B,SAAgB,iBAAiB,eAAwC;AACvE,QAAO,SAAU,QAAwB;AAEvC,MAAI,CAAC,eAAe;AAClB,YAAS,iBAAiB,sBAAsB,QAAQ;AACxD,UAAO;;AAGT,MAAI,cAAc,YAAY,MAC5B,QAAO;;;;;EAOT,SAAS,eAAoB;AAC3B,OAAI,UACF,QAAO;AAET,UAAO,gBAAgB,cAAc,IAAI;;AAI3C,MAAI,cAAc,KAAK;AACrB,qBAAkB,cAAc,IAAI;AACp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ts-manager.ts
10
- const { throwError, log } = useErrorHandler();
10
+ const { log, throwError } = useErrorHandler();
11
11
  var S3PartsManager = class {
12
12
  constructor(client, bucket, minPartSize, partUploadSemaphore, metadataManager, fileOperations, generateCompleteTag) {
13
13
  this.client = client;