@ai-matrx/sharing 0.1.0 → 0.1.1
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/CHANGELOG.md +2 -1
- package/dist/access-react.cjs +17 -25
- package/dist/access-react.cjs.map +1 -1
- package/dist/access-react.js +19 -27
- package/dist/access-react.js.map +1 -1
- package/dist/core.cjs +4 -16
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -5
- package/dist/core.d.ts +2 -5
- package/dist/core.js +9 -21
- package/dist/core.js.map +1 -1
- package/package.json +4 -4
package/dist/core.cjs
CHANGED
|
@@ -123,11 +123,11 @@ __export(core_exports, {
|
|
|
123
123
|
makePrivate: () => makePrivate,
|
|
124
124
|
makePublic: () => makePublic,
|
|
125
125
|
myPendingTableInvitations: () => myPendingTableInvitations,
|
|
126
|
-
normalizePermissionLevel: () => normalizePermissionLevel,
|
|
126
|
+
normalizePermissionLevel: () => import_access3.normalizePermissionLevel,
|
|
127
127
|
onlyOpenOrganizations: () => onlyOpenOrganizations,
|
|
128
128
|
openSecureDelivery: () => openSecureDelivery,
|
|
129
129
|
organizationDisambiguators: () => organizationDisambiguators,
|
|
130
|
-
parsePermissionLevel: () => parsePermissionLevel,
|
|
130
|
+
parsePermissionLevel: () => import_access3.parsePermissionLevel,
|
|
131
131
|
passThroughDispatch: () => passThroughDispatch,
|
|
132
132
|
peekTableShare: () => peekTableShare,
|
|
133
133
|
permissionLevelRank: () => permissionLevelRank,
|
|
@@ -3559,28 +3559,16 @@ function getResourceSharePath(resourceType, resourceId) {
|
|
|
3559
3559
|
// src/core/levels.ts
|
|
3560
3560
|
var import_access = require("@ai-matrx/data/access");
|
|
3561
3561
|
var import_access2 = require("@ai-matrx/data/access");
|
|
3562
|
-
|
|
3563
|
-
if (raw === "edit_content") return "editor";
|
|
3564
|
-
return (0, import_access.isPermissionLevel)(raw) ? raw : null;
|
|
3565
|
-
}
|
|
3562
|
+
var import_access3 = require("@ai-matrx/data/access");
|
|
3566
3563
|
var OFFERED_DB_PERMISSION_LEVELS = import_access.DB_PERMISSION_LEVELS;
|
|
3567
3564
|
var PERMISSION_LEVEL_RANK = {
|
|
3568
3565
|
...import_access.PERMISSION_LEVEL_RANK,
|
|
3569
3566
|
edit_content: import_access.PERMISSION_LEVEL_RANK.editor
|
|
3570
3567
|
};
|
|
3571
|
-
function parsePermissionLevel(raw, context) {
|
|
3572
|
-
const level = normalizePermissionLevel(raw);
|
|
3573
|
-
if (level) return level;
|
|
3574
|
-
if (raw === null || raw === void 0) return null;
|
|
3575
|
-
console.error(
|
|
3576
|
-
`[permissions] ${context}: unrecognised permission level ${JSON.stringify(raw)}. Known levels are ${import_access.PERMISSION_LEVELS.join(", ")}. Add it to PERMISSION_LEVELS in utils/permissions/levels.ts (the package ladder is re-exported there) if the database gained a new value.`
|
|
3577
|
-
);
|
|
3578
|
-
return null;
|
|
3579
|
-
}
|
|
3580
3568
|
function permissionLevelRank(level) {
|
|
3581
3569
|
const rank = PERMISSION_LEVEL_RANK[level];
|
|
3582
3570
|
if (rank === void 0) {
|
|
3583
|
-
console.error(`[permissions] no rank for permission level ${JSON.stringify(level)}. Add it to PERMISSION_LEVELS in
|
|
3571
|
+
console.error(`[permissions] no rank for permission level ${JSON.stringify(level)}. Add it to PERMISSION_LEVELS in @ai-matrx/data/access (permissionLevels.ts).`);
|
|
3584
3572
|
return Number.NaN;
|
|
3585
3573
|
}
|
|
3586
3574
|
return rank;
|