@tinacms/schema-tools 1.4.11 → 1.4.12

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.js CHANGED
@@ -238,7 +238,7 @@
238
238
  }
239
239
  if (((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) || ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude)) {
240
240
  const matches = this.getMatches({ collection });
241
- const match = picomatch([filepath], matches).length > 0;
241
+ const match = picomatch.isMatch(filepath, matches);
242
242
  if (!match) {
243
243
  return false;
244
244
  }
package/dist/index.mjs CHANGED
@@ -221,7 +221,7 @@ class TinaSchema {
221
221
  }
222
222
  if (((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) || ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude)) {
223
223
  const matches = this.getMatches({ collection });
224
- const match = picomatch([filepath], matches).length > 0;
224
+ const match = picomatch.isMatch(filepath, matches);
225
225
  if (!match) {
226
226
  return false;
227
227
  }
@@ -317,6 +317,16 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
317
317
  *
318
318
  **/
319
319
  getUser?: () => Promise<any | null>;
320
+ /**
321
+ * Used to authorize the user with the custom auth provider.
322
+ *
323
+ * If this returns a truthy value, the user will be logged in and the CMS will be enabled.
324
+ *
325
+ * If not provided, the existence of a user will be enough to authorize the user.
326
+ *
327
+ * @param context
328
+ */
329
+ authorize?: (context?: any) => Promise<any | null>;
320
330
  /**
321
331
  * Used to authenticate the user with the custom auth provider. This is called when the user clicks the login button.
322
332
  *
@@ -633,7 +643,7 @@ export interface UICollection<Form = any, CMS = any, TinaForm = any> {
633
643
  router?: (args: {
634
644
  document: Document;
635
645
  collection: Collection<true>;
636
- }) => Promise<string | undefined>;
646
+ }) => Promise<string | undefined> | string | undefined;
637
647
  /**
638
648
  * This function is called before a document is created or updated. It can be used to modify the values that are saved to the CMS. It can also be used to perform side effects such as sending a notification or triggering a build.
639
649
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/schema-tools",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {