@openinc/parse-server-opendash 4.4.1 → 4.4.2
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.
|
@@ -23,6 +23,7 @@ async function initServiceSchedulesFeature() {
|
|
|
23
23
|
.equalTo("key", ServiceSyncTypes_js_1.OUTLOOK_CONFIG_KEY)
|
|
24
24
|
.includeAll()
|
|
25
25
|
.findAll({ useMasterKey: true });
|
|
26
|
+
// TODO: Reenable when infinite loop is found
|
|
26
27
|
// for (const config of configs) {
|
|
27
28
|
// pollers.push(new ServiceCalendarSyncPoller(config).start(POLL_INTERVAL_MS));
|
|
28
29
|
// }
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import Parse from "parse/node";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
// import {
|
|
5
|
-
// grantProviderAccess,
|
|
6
|
-
// revokeProviderAccess,
|
|
7
|
-
// } from "../features/openservice/serviceProviders/index.js";
|
|
8
|
-
// import {
|
|
9
|
-
// Permissions,
|
|
10
|
-
// requirePermission,
|
|
11
|
-
// } from "../features/permissions/index.js";
|
|
12
|
-
// import { Tenant, type _User } from "../types/index.js";
|
|
13
|
-
// /**
|
|
14
|
-
// * Grant or revoke an external service provider's access to one maintenance
|
|
15
|
-
// * plan.
|
|
16
|
-
// *
|
|
17
|
-
// * Params: `{ contactId, scheduleId, revoke? }`.
|
|
18
|
-
// *
|
|
19
|
-
// * **Who may call it.** A logged-in user holding `schedule_create` — the same
|
|
20
|
-
// * capability that lets somebody set a plan up in the first place. Creating an
|
|
21
|
-
// * account for a stranger and pointing it at a customer's plan is at least as
|
|
22
|
-
// * consequential as creating the plan, so it does not get a weaker gate; and
|
|
23
|
-
// * `requirePermission` means it is a real gate, not UI that can be walked
|
|
24
|
-
// * around by calling the function directly (GRENZEN §2).
|
|
25
|
-
// *
|
|
26
|
-
// * The tenant comes from the caller's account, never from a parameter.
|
|
27
|
-
// */
|
|
28
|
-
// export async function init(name: string) {
|
|
29
|
-
// Parse.Cloud.define(
|
|
30
|
-
// name,
|
|
31
|
-
// async (request) => {
|
|
32
|
-
// await requirePermission(
|
|
33
|
-
// {
|
|
34
|
-
// sessionToken: request.user?.getSessionToken(),
|
|
35
|
-
// master: request.master,
|
|
36
|
-
// },
|
|
37
|
-
// Permissions.SERVICE.schedule_create,
|
|
38
|
-
// "Granting service provider access requires schedule creation rights.",
|
|
39
|
-
// );
|
|
40
|
-
// const user = request.user as _User | undefined;
|
|
41
|
-
// const tenant = user?.get("tenant") as Tenant | undefined;
|
|
42
|
-
// if (!tenant) {
|
|
43
|
-
// throw new Parse.Error(
|
|
44
|
-
// Parse.Error.OPERATION_FORBIDDEN,
|
|
45
|
-
// `${name}: the calling user has no tenant`,
|
|
46
|
-
// );
|
|
47
|
-
// }
|
|
48
|
-
// const { contactId, scheduleId, revoke } = request.params as {
|
|
49
|
-
// contactId?: string;
|
|
50
|
-
// scheduleId?: string;
|
|
51
|
-
// revoke?: boolean;
|
|
52
|
-
// };
|
|
53
|
-
// if (!contactId || !scheduleId) {
|
|
54
|
-
// throw new Parse.Error(
|
|
55
|
-
// Parse.Error.INVALID_QUERY,
|
|
56
|
-
// `${name} needs "contactId" and "scheduleId"`,
|
|
57
|
-
// );
|
|
58
|
-
// }
|
|
59
|
-
// if (revoke) {
|
|
60
|
-
// const result = await revokeProviderAccess(
|
|
61
|
-
// tenant,
|
|
62
|
-
// contactId,
|
|
63
|
-
// scheduleId,
|
|
64
|
-
// );
|
|
65
|
-
// console.log(
|
|
66
|
-
// `[${name}] revoked contact ${contactId} from schedule ${scheduleId}`,
|
|
67
|
-
// );
|
|
68
|
-
// return result;
|
|
69
|
-
// }
|
|
70
|
-
// const result = await grantProviderAccess(tenant, contactId, scheduleId);
|
|
71
|
-
// console.log(
|
|
72
|
-
// `[${name}] granted contact ${contactId} on schedule ${scheduleId} ` +
|
|
73
|
-
// `as user ${result.userId}${result.created ? " (new account)" : ""}`,
|
|
74
|
-
// );
|
|
75
|
-
// return result;
|
|
76
|
-
// },
|
|
77
|
-
// { requireUser: true },
|
|
78
|
-
// );
|
|
79
|
-
// }
|