@mj-biz-apps/common-activity-sync 5.41.0 → 5.43.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/ActivitySyncEngine.d.ts +59 -1
- package/dist/ActivitySyncEngine.d.ts.map +1 -1
- package/dist/ActivitySyncEngine.js +159 -6
- package/dist/ActivitySyncEngine.js.map +1 -1
- package/dist/attachments.d.ts +106 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/attachments.js +147 -0
- package/dist/attachments.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/participants.d.ts +30 -0
- package/dist/participants.d.ts.map +1 -1
- package/dist/participants.js +48 -0
- package/dist/participants.js.map +1 -1
- package/dist/providers/GraphCalendarTransport.d.ts +115 -0
- package/dist/providers/GraphCalendarTransport.d.ts.map +1 -0
- package/dist/providers/GraphCalendarTransport.js +139 -0
- package/dist/providers/GraphCalendarTransport.js.map +1 -0
- package/dist/providers/GraphCommunicationTransport.d.ts.map +1 -1
- package/dist/providers/GraphCommunicationTransport.js +18 -4
- package/dist/providers/GraphCommunicationTransport.js.map +1 -1
- package/dist/providers/GraphMessageMapper.d.ts +2 -0
- package/dist/providers/GraphMessageMapper.d.ts.map +1 -1
- package/dist/providers/GraphMessageMapper.js +3 -0
- package/dist/providers/GraphMessageMapper.js.map +1 -1
- package/dist/providers/MSGraphActivitySyncProvider.d.ts +39 -4
- package/dist/providers/MSGraphActivitySyncProvider.d.ts.map +1 -1
- package/dist/providers/MSGraphActivitySyncProvider.js +45 -10
- package/dist/providers/MSGraphActivitySyncProvider.js.map +1 -1
- package/dist/providers/MSGraphCalendarSyncProvider.d.ts +55 -14
- package/dist/providers/MSGraphCalendarSyncProvider.d.ts.map +1 -1
- package/dist/providers/MSGraphCalendarSyncProvider.js +112 -38
- package/dist/providers/MSGraphCalendarSyncProvider.js.map +1 -1
- package/dist/providers/MessageTransport.d.ts +90 -0
- package/dist/providers/MessageTransport.d.ts.map +1 -1
- package/dist/providers/MessageTransport.js +72 -0
- package/dist/providers/MessageTransport.js.map +1 -1
- package/dist/providers/RecordedMessageTransport.d.ts.map +1 -1
- package/dist/providers/RecordedMessageTransport.js +25 -11
- package/dist/providers/RecordedMessageTransport.js.map +1 -1
- package/dist/stages.d.ts +11 -0
- package/dist/stages.d.ts.map +1 -1
- package/dist/stages.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphCommunicationTransport.js","sourceRoot":"","sources":["../../src/providers/GraphCommunicationTransport.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D,qGAAqG;AACrG,MAAM,CAAC,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;AA4D9D,MAAM,OAAO,2BAA2B;IAIpC,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;QAH5C,aAAQ,GAAG,8CAA8C,CAAC;QAC1D,WAAM,GAAG,IAAI,CAAC;IAEiC,CAAC;IAEzD,KAAK,CAAC,KAAK,CAAC,KAA0B;QACzC,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvD,MAAM,OAAO,GAAI,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAW,CAAC,MAAM,CACtE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAC/C,CAAC;QACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,wFAAwF;YACxF,gDAAgD;YAChD,MAAM,IAAI,KAAK,CACX,QAAQ,qBAAqB,8CAA8C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBAC7F,+CAA+C,CACtD,CAAC;QACN,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;QAEnD,wFAAwF;QACxF,mFAAmF;QACnF,yFAAyF;QACzF,iFAAiF;QACjF,sFAAsF;QACtF,0FAA0F;QAC1F,2FAA2F;QAC3F,qFAAqF;QACrF,wFAAwF;QACxF,0FAA0F;QAC1F,4DAA4D;QAC5D,EAAE;QACF,wFAAwF;QACxF,4FAA4F;QAC5F,0FAA0F;QAC1F,2FAA2F;QAC3F,4FAA4F;QAC5F,0FAA0F;QAC1F,2FAA2F;QAC3F,uFAAuF;QACvF,EAAE;QACF,8FAA8F;QAC9F,4FAA4F;QAC5F,6FAA6F;QAC7F,gFAAgF;QAChF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,CACrC,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,EACvD,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,CACnF,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,yCAAyC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAChH,CAAC;QAED,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAA8B,CAAC;QAExE,MAAM,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"GraphCommunicationTransport.js","sourceRoot":"","sources":["../../src/providers/GraphCommunicationTransport.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,MAAM,CAAC,M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;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAOpC;IACG,OAAO;QACH,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,CAAC,iBAAiB;YACnB,MAAM,QAAQ,GAAG,MAAM,IAAI;iBACtB,mBAAmB,EAAE;iBACrB,aAAa,CAAwB,IAAI,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAClG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,CAAC,cAAc,4BAA4B,CAAC,CAAC;YACpF,CAAC;YACD,OAAO,QAAQ,CAAC,MAAM,CAAC;QAC3B,CAAC;QACD,KAAK,CAAC,eAAe;YACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,4BAA4B,CAAC,CAAC;YAC7E,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACZ,oFAAoF;gBACpF,oDAAoD;gBACpD,MAAM,IAAI,KAAK,CACX,8BAA8B,4BAA4B,uBAAuB;oBAC7E,uEAAuE,CAC9E,CAAC;YACN,CAAC;YACD,OAAO,QAAQ,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -27,6 +27,8 @@ export interface GraphMessage {
|
|
|
27
27
|
ccRecipients?: GraphRecipient[] | null;
|
|
28
28
|
bccRecipients?: GraphRecipient[] | null;
|
|
29
29
|
[key: string]: unknown;
|
|
30
|
+
/** Graph's own flag. Cheap; the attachment LIST costs a separate call per message. */
|
|
31
|
+
hasAttachments?: boolean;
|
|
30
32
|
}
|
|
31
33
|
export interface MapResult {
|
|
32
34
|
Items: NormalizedItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphMessageMapper.d.ts","sourceRoot":"","sources":["../../src/providers/GraphMessageMapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAsC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@@ -57,6 +57,9 @@ export function MapGraphMessage(message, mailbox, issues) {
|
|
|
57
57
|
ExternalID: id,
|
|
58
58
|
ExternalThreadID: (message.conversationId ?? '').trim() || null,
|
|
59
59
|
TypeCode: 'Email',
|
|
60
|
+
// Graph's flag, taken at face value. Absent means "not told", which we treat as none rather
|
|
61
|
+
// than paying a per-message list call on the chance something is there.
|
|
62
|
+
HasAttachments: message.hasAttachments === true,
|
|
60
63
|
Subject: (message.subject ?? '').trim() || '(no subject)',
|
|
61
64
|
Body: (message.bodyPreview ?? message.body?.content ?? '').trim() || null,
|
|
62
65
|
StartedAt: startedAt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphMessageMapper.js","sourceRoot":"","sources":["../../src/providers/GraphMessageMapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphMessageMapper.js","sourceRoot":"","sources":["../../src/providers/GraphMessageMapper.ts"],"names":[],"mappings":"AAuCA,SAAS,eAAe,CAAC,OAAe;IACpC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC5B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,eAAe,CACpB,SAA4C,EAC5C,IAA6B,EAC7B,MAAgB,EAChB,OAAe;IAEf,MAAM,EAAE,GAAG,SAAS,EAAE,YAAY,IAAI,IAAI,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG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AE,CAAC;IACX,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAC;QACnG,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,eAAe,CAAC,KAAqB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACvE,IAAI,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
import { BaseActivitySyncProvider } from '../BaseActivitySyncProvider.js';
|
|
2
2
|
import type { ActivitySourceQuery, NormalizedItem, RawBatch } from '../types.js';
|
|
3
3
|
import type { ActivityMessageTransport, ActivityTransportContext, ActivityTransportFactory } from './MessageTransport.js';
|
|
4
|
+
/**
|
|
5
|
+
* Why live fetch is off, and what to do about it.
|
|
6
|
+
*
|
|
7
|
+
* NAMING THE WAY OUT MATTERS AS MUCH AS THE REFUSAL: without it an operator who HAS checked the
|
|
8
|
+
* policy has no supported next step, and the tempting one is to go editing a database row.
|
|
9
|
+
*
|
|
10
|
+
* An earlier version of this string named only one of them — "call AllowLiveMailboxFetch() with the
|
|
11
|
+
* group the policy names" — which was wrong twice over. It assumed every deployment ends up with an
|
|
12
|
+
* Exchange RBAC assignment, when `TenantWideAccepted` exists precisely because most will not; an
|
|
13
|
+
* operator in a tenant with no RBAC owner read that as "you are blocked" and was left with inventing
|
|
14
|
+
* a group name or bypassing the gate. And it pointed at a FUNCTION when the path a deployment
|
|
15
|
+
* actually takes is `LoadLiveMailboxPolicyFromEnv`, already wired into `common-server`'s bootstrap,
|
|
16
|
+
* which reads environment variables. Telling someone to write code they do not need to write is the
|
|
17
|
+
* same defect in miniature: a documented route that is not the route.
|
|
18
|
+
*
|
|
19
|
+
* The variable names are referenced rather than imported — `common-server` depends on this package,
|
|
20
|
+
* not the other way round — which is the same way the attestation's own docblock already refers to
|
|
21
|
+
* `LoadLiveMailboxPolicyFromEnv` by name.
|
|
22
|
+
*/
|
|
4
23
|
export declare const LIVE_GRAPH_REFUSAL: string;
|
|
5
24
|
export declare const NO_TRANSPORT_REFUSAL: string;
|
|
6
25
|
export declare const NO_CREDENTIAL_REF_REFUSAL: string;
|
|
7
26
|
export declare class MSGraphActivitySyncProvider extends BaseActivitySyncProvider {
|
|
8
27
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
28
|
+
* Turning it on is a deliberate act by someone who has confirmed the Application Access
|
|
29
|
+
* Policy exists. Nothing in this package does that for you.
|
|
11
30
|
*
|
|
12
31
|
* It gates the LIVE transport only — a recorded transport needs no such confirmation
|
|
13
32
|
* because it reaches no mailbox, and is allowed through below.
|
|
33
|
+
*
|
|
34
|
+
* DEFAULTS TO THE HOST'S ATTESTATION, NOT TO FALSE. A bare `false` made this unreachable in
|
|
35
|
+
* the only way that ships: `MJGlobal.ClassFactory` builds plugins with no arguments, so
|
|
36
|
+
* through the engine this was permanently off and the parameter could be set by tests and
|
|
37
|
+
* the demo alone. That is the same defect the transport factory had — a seam that was
|
|
38
|
+
* described, exported, and impossible to reach — so it gets the same fix, a host registry.
|
|
39
|
+
* With no attestation registered the default is still false, so an unconfigured host refuses
|
|
40
|
+
* exactly as before.
|
|
14
41
|
*/
|
|
15
42
|
private readonly AllowLiveFetch;
|
|
16
43
|
/** Where messages come from. Without one this provider refuses rather than pretending. */
|
|
@@ -33,11 +60,19 @@ export declare class MSGraphActivitySyncProvider extends BaseActivitySyncProvide
|
|
|
33
60
|
get IsLive(): boolean;
|
|
34
61
|
constructor(
|
|
35
62
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
63
|
+
* Turning it on is a deliberate act by someone who has confirmed the Application Access
|
|
64
|
+
* Policy exists. Nothing in this package does that for you.
|
|
38
65
|
*
|
|
39
66
|
* It gates the LIVE transport only — a recorded transport needs no such confirmation
|
|
40
67
|
* because it reaches no mailbox, and is allowed through below.
|
|
68
|
+
*
|
|
69
|
+
* DEFAULTS TO THE HOST'S ATTESTATION, NOT TO FALSE. A bare `false` made this unreachable in
|
|
70
|
+
* the only way that ships: `MJGlobal.ClassFactory` builds plugins with no arguments, so
|
|
71
|
+
* through the engine this was permanently off and the parameter could be set by tests and
|
|
72
|
+
* the demo alone. That is the same defect the transport factory had — a seam that was
|
|
73
|
+
* described, exported, and impossible to reach — so it gets the same fix, a host registry.
|
|
74
|
+
* With no attestation registered the default is still false, so an unconfigured host refuses
|
|
75
|
+
* exactly as before.
|
|
41
76
|
*/
|
|
42
77
|
AllowLiveFetch?: boolean,
|
|
43
78
|
/** Where messages come from. Without one this provider refuses rather than pretending. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphActivitySyncProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MSGraphActivitySyncProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MSGraphActivitySyncProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MSGraphActivitySyncProvider.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjF,OAAO,KAAK,EACR,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EAC3B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,QAS4B,CAAC;AAE5D,eAAO,MAAM,oBAAoB,QAEmB,CAAC;AAErD,eAAO,MAAM,yBAAyB,QAGX,CAAC;AAE5B,qBACa,2BAA4B,SAAQ,wBAAwB;IAoBjE;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,0FAA0F;IAC1F,OAAO,CAAC,SAAS,CAAC;IAClB,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAtC7B,SAAgB,IAAI,EAAG,SAAS,CAAU;IAC1C,SAAgB,gBAAgB,kBAAkB;IAElD;;;;;;;;;;OAUG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;;IAGG;;;;;;;;;;;;;;OAcG;IACc,cAAc,GAAE,OAAsC;IACvE,0FAA0F;IAClF,SAAS,CAAC,EAAE,wBAAwB,YAAA;IAC5C,6EAA6E;IAC5D,OAAO,CAAC,EAAE,wBAAwB,YAAA;IAKvD,4FAA4F;IAC5F,OAAO,CAAC,oBAAoB,CAAuB;IAEnD;;;;;;;;;;;OAWG;IACa,SAAS,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;cAkClD,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAsCvE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,GAAG,cAAc,EAAE;CAuBnF"}
|
|
@@ -20,21 +20,48 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
20
20
|
* provider and MJ's Credentials engine; a recorded one replays captured payloads through the same
|
|
21
21
|
* mapping. Only the outermost call differs between them.
|
|
22
22
|
*
|
|
23
|
-
* THE TENANT-WIDE READ IS STILL REFUSED BY DEFAULT.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* THE TENANT-WIDE READ IS STILL REFUSED BY DEFAULT. The reason is unchanged: app-only `Mail.Read`
|
|
24
|
+
* reads EVERY mailbox in the tenant until an Exchange Application Access Policy scopes the app
|
|
25
|
+
* registration to a security group. Wiring a transport does not make that safe, so the gate stays.
|
|
26
|
+
*
|
|
27
|
+
* What changed is that the gate is now REACHABLE. It defaults to the host's attestation
|
|
28
|
+
* (`AllowLiveMailboxFetch`) rather than to a bare `false` that `ClassFactory` could never override —
|
|
29
|
+
* an unconfigured host still refuses, but a scoped one can say so in the one place that ships.
|
|
27
30
|
*
|
|
28
31
|
* @module @mj-biz-apps/common-activity-sync
|
|
29
32
|
*/
|
|
30
33
|
import { RegisterClass } from '@memberjunction/global';
|
|
31
34
|
import { BaseActivitySyncProvider } from '../BaseActivitySyncProvider.js';
|
|
32
35
|
import { MapGraphMessages } from './GraphMessageMapper.js';
|
|
33
|
-
import { HostActivityTransportFactory } from './MessageTransport.js';
|
|
36
|
+
import { HostActivityTransportFactory, HostAllowsLiveMailboxFetch } from './MessageTransport.js';
|
|
37
|
+
/**
|
|
38
|
+
* Why live fetch is off, and what to do about it.
|
|
39
|
+
*
|
|
40
|
+
* NAMING THE WAY OUT MATTERS AS MUCH AS THE REFUSAL: without it an operator who HAS checked the
|
|
41
|
+
* policy has no supported next step, and the tempting one is to go editing a database row.
|
|
42
|
+
*
|
|
43
|
+
* An earlier version of this string named only one of them — "call AllowLiveMailboxFetch() with the
|
|
44
|
+
* group the policy names" — which was wrong twice over. It assumed every deployment ends up with an
|
|
45
|
+
* Exchange RBAC assignment, when `TenantWideAccepted` exists precisely because most will not; an
|
|
46
|
+
* operator in a tenant with no RBAC owner read that as "you are blocked" and was left with inventing
|
|
47
|
+
* a group name or bypassing the gate. And it pointed at a FUNCTION when the path a deployment
|
|
48
|
+
* actually takes is `LoadLiveMailboxPolicyFromEnv`, already wired into `common-server`'s bootstrap,
|
|
49
|
+
* which reads environment variables. Telling someone to write code they do not need to write is the
|
|
50
|
+
* same defect in miniature: a documented route that is not the route.
|
|
51
|
+
*
|
|
52
|
+
* The variable names are referenced rather than imported — `common-server` depends on this package,
|
|
53
|
+
* not the other way round — which is the same way the attestation's own docblock already refers to
|
|
54
|
+
* `LoadLiveMailboxPolicyFromEnv` by name.
|
|
55
|
+
*/
|
|
34
56
|
export const LIVE_GRAPH_REFUSAL = 'Live Graph fetch is disabled. MSGraphProvider uses app-only auth, so Mail.Read reads ' +
|
|
35
57
|
'EVERY mailbox in the tenant until an Exchange Application Access Policy scopes the ' +
|
|
36
|
-
'app registration to a security group.
|
|
37
|
-
'this, and use a recorded transport or FixtureActivitySyncProvider until then.'
|
|
58
|
+
'app registration to a security group. Find out whether that policy exists before enabling ' +
|
|
59
|
+
'this, and use a recorded transport or FixtureActivitySyncProvider until then. ' +
|
|
60
|
+
'Then record the answer, whichever it is: the app IS scoped and you name the group, or it is ' +
|
|
61
|
+
'not and the tenant-wide grant is accepted deliberately, in writing, by a named person on a ' +
|
|
62
|
+
'date. Both are legitimate. Not knowing is not. A host that reads deployment configuration ' +
|
|
63
|
+
'sets its ACTIVITY_SYNC_MAILBOX_POLICY_* variables (see @mj-biz-apps/common-server); anything ' +
|
|
64
|
+
'else calls AllowLiveMailboxFetch() once at bootstrap.';
|
|
38
65
|
export const NO_TRANSPORT_REFUSAL = 'No mailbox transport was supplied. Construct this provider with a GraphCommunicationTransport ' +
|
|
39
66
|
'(live) or a RecordedMessageTransport (replay).';
|
|
40
67
|
export const NO_CREDENTIAL_REF_REFUSAL = 'This ActivitySyncConnection names no credential. Set its CredentialsRef to the NAME of an ' +
|
|
@@ -57,13 +84,21 @@ let MSGraphActivitySyncProvider = class MSGraphActivitySyncProvider extends Base
|
|
|
57
84
|
}
|
|
58
85
|
constructor(
|
|
59
86
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
87
|
+
* Turning it on is a deliberate act by someone who has confirmed the Application Access
|
|
88
|
+
* Policy exists. Nothing in this package does that for you.
|
|
62
89
|
*
|
|
63
90
|
* It gates the LIVE transport only — a recorded transport needs no such confirmation
|
|
64
91
|
* because it reaches no mailbox, and is allowed through below.
|
|
92
|
+
*
|
|
93
|
+
* DEFAULTS TO THE HOST'S ATTESTATION, NOT TO FALSE. A bare `false` made this unreachable in
|
|
94
|
+
* the only way that ships: `MJGlobal.ClassFactory` builds plugins with no arguments, so
|
|
95
|
+
* through the engine this was permanently off and the parameter could be set by tests and
|
|
96
|
+
* the demo alone. That is the same defect the transport factory had — a seam that was
|
|
97
|
+
* described, exported, and impossible to reach — so it gets the same fix, a host registry.
|
|
98
|
+
* With no attestation registered the default is still false, so an unconfigured host refuses
|
|
99
|
+
* exactly as before.
|
|
65
100
|
*/
|
|
66
|
-
AllowLiveFetch =
|
|
101
|
+
AllowLiveFetch = HostAllowsLiveMailboxFetch(),
|
|
67
102
|
/** Where messages come from. Without one this provider refuses rather than pretending. */
|
|
68
103
|
Transport,
|
|
69
104
|
/** How a host builds a transport for a connection. See {@link Configure}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphActivitySyncProvider.js","sourceRoot":"","sources":["../../src/providers/MSGraphActivitySyncProvider.ts"],"names":[],"mappings":";;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"MSGraphActivitySyncProvider.js","sourceRoot":"","sources":["../../src/providers/MSGraphActivitySyncProvider.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAOjG;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC3B,uFAAuF;IACvF,qFAAqF;IACrF,4FAA4F;IAC5F,gFAAgF;IAChF,8FAA8F;IAC9F,6FAA6F;IAC7F,4FAA4F;IAC5F,+FAA+F;IAC/F,uDAAuD,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAC7B,gGAAgG;IAChG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1JY,2BAA2B;IADvC,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC;;GAC3C,2BAA2B,CA0JvC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BaseActivitySyncProvider } from '../BaseActivitySyncProvider.js';
|
|
2
2
|
import type { ActivitySourceQuery, NormalizedItem, RawBatch } from '../types.js';
|
|
3
|
+
import type { ActivityMessageTransport, ActivityTransportContext, ActivityTransportFactory } from './MessageTransport.js';
|
|
3
4
|
export declare const LIVE_GRAPH_CALENDAR_REFUSAL: string;
|
|
5
|
+
export declare const NO_CALENDAR_TRANSPORT_REFUSAL: string;
|
|
6
|
+
export declare const NO_CALENDAR_CREDENTIAL_REF_REFUSAL: string;
|
|
4
7
|
export interface GraphAttendeeLike {
|
|
5
8
|
type?: string;
|
|
6
9
|
emailAddress?: {
|
|
@@ -33,27 +36,65 @@ export interface GraphEventLike {
|
|
|
33
36
|
attendees?: GraphAttendeeLike[];
|
|
34
37
|
isCancelled?: boolean;
|
|
35
38
|
seriesMasterId?: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
GetEvents(params: {
|
|
39
|
-
Mailbox: string;
|
|
40
|
-
Since: Date | null;
|
|
41
|
-
Top: number;
|
|
42
|
-
}): Promise<{
|
|
43
|
-
Success?: boolean;
|
|
44
|
-
ErrorMessage?: string;
|
|
45
|
-
Events?: GraphEventLike[];
|
|
46
|
-
}>;
|
|
39
|
+
/** Graph's own flag. An .ics or a deck attached to the invite lands here. */
|
|
40
|
+
hasAttachments?: boolean;
|
|
47
41
|
}
|
|
48
42
|
/** Map one Graph event. Exported so a check can prove the mapping without a mailbox. */
|
|
49
43
|
export declare function MapGraphEvent(event: GraphEventLike, issues: string[]): NormalizedItem | null;
|
|
50
44
|
export declare class MSGraphCalendarSyncProvider extends BaseActivitySyncProvider {
|
|
45
|
+
/**
|
|
46
|
+
* Defaults to the HOST'S ATTESTATION, and to the same one mail uses.
|
|
47
|
+
*
|
|
48
|
+
* A bare `false` made this unreachable in the only way that ships — `ClassFactory` passes no
|
|
49
|
+
* arguments — so live calendar fetch could be enabled by tests and nothing else. It is the
|
|
50
|
+
* same Exchange Application Access Policy that scopes `Mail.Read` and `Calendars.Read`, so a
|
|
51
|
+
* host that has attested for one has attested for both; a second switch would let someone
|
|
52
|
+
* record half a decision.
|
|
53
|
+
*/
|
|
51
54
|
private readonly AllowLiveFetch;
|
|
52
|
-
|
|
55
|
+
/** Where events come from. Without one this provider refuses rather than pretending. */
|
|
56
|
+
private Transport?;
|
|
57
|
+
/** How a host builds a transport for a connection. See {@link Configure}. */
|
|
58
|
+
private readonly Factory?;
|
|
53
59
|
readonly Kind: "Calendar";
|
|
54
60
|
readonly ProviderTypeCode = "Microsoft365";
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Reflects the TRANSPORT rather than being hard-coded true.
|
|
63
|
+
*
|
|
64
|
+
* The engine refuses to write `Source: 'Integration'` rows from a non-live provider. While this
|
|
65
|
+
* class always claimed `IsLive = true`, a replayed calendar run would have been indistinguishable
|
|
66
|
+
* from a real one in the database afterwards — the exact confusion the flag exists to prevent.
|
|
67
|
+
* Defaults to true with no transport, so an unconfigured provider is treated as the stricter case.
|
|
68
|
+
*/
|
|
69
|
+
get IsLive(): boolean;
|
|
70
|
+
constructor(
|
|
71
|
+
/**
|
|
72
|
+
* Defaults to the HOST'S ATTESTATION, and to the same one mail uses.
|
|
73
|
+
*
|
|
74
|
+
* A bare `false` made this unreachable in the only way that ships — `ClassFactory` passes no
|
|
75
|
+
* arguments — so live calendar fetch could be enabled by tests and nothing else. It is the
|
|
76
|
+
* same Exchange Application Access Policy that scopes `Mail.Read` and `Calendars.Read`, so a
|
|
77
|
+
* host that has attested for one has attested for both; a second switch would let someone
|
|
78
|
+
* record half a decision.
|
|
79
|
+
*/
|
|
80
|
+
AllowLiveFetch?: boolean,
|
|
81
|
+
/** Where events come from. Without one this provider refuses rather than pretending. */
|
|
82
|
+
Transport?: ActivityMessageTransport | undefined,
|
|
83
|
+
/** How a host builds a transport for a connection. See {@link Configure}. */
|
|
84
|
+
Factory?: ActivityTransportFactory | undefined);
|
|
85
|
+
/** Why this provider cannot fetch, decided at Configure time and reported at fetch time. */
|
|
86
|
+
private ConfigurationRefusal;
|
|
87
|
+
/**
|
|
88
|
+
* Reads `ActivitySyncConnection.CredentialsRef` and builds this connection's transport from it.
|
|
89
|
+
*
|
|
90
|
+
* Identical in shape to the message provider's, and deliberately so: a connection configures ONE
|
|
91
|
+
* credential, and both of its surfaces resolve through it. A calendar-specific path would let the
|
|
92
|
+
* two disagree about which credential a connection uses.
|
|
93
|
+
*
|
|
94
|
+
* A transport passed to the CONSTRUCTOR wins and is never replaced — a database row must not be
|
|
95
|
+
* able to reach in and swap it.
|
|
96
|
+
*/
|
|
97
|
+
Configure(context: ActivityTransportContext): void;
|
|
57
98
|
protected FetchRaw(query: ActivitySourceQuery): Promise<RawBatch>;
|
|
58
99
|
protected Normalize(raw: RawBatch): NormalizedItem[];
|
|
59
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphCalendarSyncProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MSGraphCalendarSyncProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MSGraphCalendarSyncProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MSGraphCalendarSyncProvider.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAmB,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElG,OAAO,KAAK,EACR,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,2BAA2B,QAKwC,CAAC;AAEjF,eAAO,MAAM,6BAA6B,QAEU,CAAC;AAErD,eAAO,MAAM,kCAAkC,QAGpB,CAAC;AA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A6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IA7B7B,SAAgB,IAAI,EAAG,UAAU,CAAU;IAC3C,SAAgB,gBAAgB,kBAAkB;IAElD;;;;;;;OAOG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;;IAGG;;;;;;;;OAQG;IACc,cAAc,GAAE,OAAsC;IACvE,wFAAwF;IAChF,SAAS,CAAC,EAAE,wBAAwB,YAAA;IAC5C,6EAA6E;IAC5D,OAAO,CAAC,EAAE,wBAAwB,YAAA;IAKvD,4FAA4F;IAC5F,OAAO,CAAC,oBAAoB,CAAuB;IAEnD;;;;;;;;;OASG;IACa,SAAS,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;cA6BlD,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IA0BvE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,cAAc,EAAE;CAQvD"}
|
|
@@ -8,17 +8,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
* Microsoft Graph calendar.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Microsoft Graph calendar.
|
|
12
|
+
*
|
|
13
|
+
* WHAT CHANGED. This class declared a `GraphEventFetcher` seam that NOTHING IMPLEMENTED, reachable
|
|
14
|
+
* only as the second constructor argument — which `MJGlobal.ClassFactory` never passes, because it
|
|
15
|
+
* builds plugins with no arguments. So through the engine every calendar fetch returned
|
|
16
|
+
* `Payloads: []` and logged "no transport is wired". Written, typechecked, exported and refused:
|
|
17
|
+
* the same defect `MSGraphActivitySyncProvider` had before its transport landed, one surface over.
|
|
18
|
+
*
|
|
19
|
+
* It now uses the same `ActivityMessageTransport` seam as mail, served by the same host factory,
|
|
20
|
+
* which dispatches on `DriverClass`. `GraphCalendarTransport` wraps MJ's `GetEvents`; a recorded
|
|
21
|
+
* transport replays captured payloads through the same mapper.
|
|
22
|
+
*
|
|
23
|
+
* THE TENANT-WIDE READ IS STILL REFUSED BY DEFAULT, and for the same reason as mail: app-only
|
|
24
|
+
* `Calendars.Read` reads EVERY calendar in the tenant until an Exchange policy scopes the app
|
|
25
|
+
* registration. It is the SAME policy and the SAME attestation — a host that has confirmed it for
|
|
26
|
+
* mail has confirmed it for calendar, so this reads `AllowLiveMailboxFetch` rather than inventing a
|
|
27
|
+
* second switch someone could set to only half the truth.
|
|
14
28
|
*/
|
|
15
|
-
import { LogError } from '@memberjunction/core';
|
|
16
29
|
import { RegisterClass } from '@memberjunction/global';
|
|
17
30
|
import { BaseActivitySyncProvider } from '../BaseActivitySyncProvider.js';
|
|
31
|
+
import { HostActivityTransportFactory, HostAllowsLiveMailboxFetch } from './MessageTransport.js';
|
|
18
32
|
export const LIVE_GRAPH_CALENDAR_REFUSAL = 'Live Graph calendar fetch is disabled. App-only auth makes Calendars.Read tenant-wide, ' +
|
|
19
33
|
'so it reads EVERY calendar until an Exchange Application Access Policy scopes the app ' +
|
|
20
34
|
'registration to a security group — the same policy Mail.Read needs. Confirm it exists ' +
|
|
21
|
-
'before enabling this, and use FixtureActivitySyncProvider until then.'
|
|
35
|
+
'before enabling this, and use FixtureActivitySyncProvider until then. Once confirmed, call ' +
|
|
36
|
+
'AllowLiveMailboxFetch() at host bootstrap with the group the policy names.';
|
|
37
|
+
export const NO_CALENDAR_TRANSPORT_REFUSAL = 'No calendar transport was supplied. Construct this provider with a GraphCalendarTransport ' +
|
|
38
|
+
'(live) or a RecordedMessageTransport (replay).';
|
|
39
|
+
export const NO_CALENDAR_CREDENTIAL_REF_REFUSAL = 'This ActivitySyncConnection names no credential. Set its CredentialsRef to the NAME of an ' +
|
|
40
|
+
'"Azure Service Principal" credential in MJ — that column holds a Credentials engine key, ' +
|
|
41
|
+
'never a secret value.';
|
|
22
42
|
function normalize(value) {
|
|
23
43
|
const trimmed = value?.trim().toLowerCase();
|
|
24
44
|
return trimmed ? trimmed : null;
|
|
@@ -72,6 +92,7 @@ export function MapGraphEvent(event, issues) {
|
|
|
72
92
|
ExternalID: externalID,
|
|
73
93
|
ExternalThreadID: event.seriesMasterId?.trim() || null,
|
|
74
94
|
TypeCode: 'Meeting',
|
|
95
|
+
HasAttachments: event.hasAttachments === true,
|
|
75
96
|
Subject: event.subject?.trim() || '(no subject)',
|
|
76
97
|
Body: event.bodyPreview ?? null,
|
|
77
98
|
StartedAt: startedAt,
|
|
@@ -84,48 +105,101 @@ export function MapGraphEvent(event, issues) {
|
|
|
84
105
|
};
|
|
85
106
|
}
|
|
86
107
|
let MSGraphCalendarSyncProvider = class MSGraphCalendarSyncProvider extends BaseActivitySyncProvider {
|
|
87
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Reflects the TRANSPORT rather than being hard-coded true.
|
|
110
|
+
*
|
|
111
|
+
* The engine refuses to write `Source: 'Integration'` rows from a non-live provider. While this
|
|
112
|
+
* class always claimed `IsLive = true`, a replayed calendar run would have been indistinguishable
|
|
113
|
+
* from a real one in the database afterwards — the exact confusion the flag exists to prevent.
|
|
114
|
+
* Defaults to true with no transport, so an unconfigured provider is treated as the stricter case.
|
|
115
|
+
*/
|
|
116
|
+
get IsLive() {
|
|
117
|
+
return this.Transport?.IsLive ?? true;
|
|
118
|
+
}
|
|
119
|
+
constructor(
|
|
120
|
+
/**
|
|
121
|
+
* Defaults to the HOST'S ATTESTATION, and to the same one mail uses.
|
|
122
|
+
*
|
|
123
|
+
* A bare `false` made this unreachable in the only way that ships — `ClassFactory` passes no
|
|
124
|
+
* arguments — so live calendar fetch could be enabled by tests and nothing else. It is the
|
|
125
|
+
* same Exchange Application Access Policy that scopes `Mail.Read` and `Calendars.Read`, so a
|
|
126
|
+
* host that has attested for one has attested for both; a second switch would let someone
|
|
127
|
+
* record half a decision.
|
|
128
|
+
*/
|
|
129
|
+
AllowLiveFetch = HostAllowsLiveMailboxFetch(),
|
|
130
|
+
/** Where events come from. Without one this provider refuses rather than pretending. */
|
|
131
|
+
Transport,
|
|
132
|
+
/** How a host builds a transport for a connection. See {@link Configure}. */
|
|
133
|
+
Factory) {
|
|
88
134
|
super();
|
|
89
135
|
this.AllowLiveFetch = AllowLiveFetch;
|
|
90
|
-
this.
|
|
136
|
+
this.Transport = Transport;
|
|
137
|
+
this.Factory = Factory;
|
|
91
138
|
this.Kind = 'Calendar';
|
|
92
139
|
this.ProviderTypeCode = 'Microsoft365';
|
|
93
|
-
this.
|
|
140
|
+
/** Why this provider cannot fetch, decided at Configure time and reported at fetch time. */
|
|
141
|
+
this.ConfigurationRefusal = null;
|
|
94
142
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Reads `ActivitySyncConnection.CredentialsRef` and builds this connection's transport from it.
|
|
145
|
+
*
|
|
146
|
+
* Identical in shape to the message provider's, and deliberately so: a connection configures ONE
|
|
147
|
+
* credential, and both of its surfaces resolve through it. A calendar-specific path would let the
|
|
148
|
+
* two disagree about which credential a connection uses.
|
|
149
|
+
*
|
|
150
|
+
* A transport passed to the CONSTRUCTOR wins and is never replaced — a database row must not be
|
|
151
|
+
* able to reach in and swap it.
|
|
152
|
+
*/
|
|
153
|
+
Configure(context) {
|
|
154
|
+
if (this.Transport) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const ref = (context.CredentialsRef ?? '').trim();
|
|
158
|
+
if (!ref) {
|
|
159
|
+
this.ConfigurationRefusal = NO_CALENDAR_CREDENTIAL_REF_REFUSAL;
|
|
160
|
+
return;
|
|
98
161
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
'Keep AllowLiveFetch false and use FixtureActivitySyncProvider.',
|
|
106
|
-
],
|
|
107
|
-
};
|
|
162
|
+
const factory = this.Factory ?? HostActivityTransportFactory();
|
|
163
|
+
if (!factory) {
|
|
164
|
+
this.ConfigurationRefusal =
|
|
165
|
+
`This connection names credential "${ref}", but no transport factory is registered in ` +
|
|
166
|
+
'this host, so the credential cannot be resolved.';
|
|
167
|
+
return;
|
|
108
168
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
169
|
+
// NOT caught. A factory that throws is a host wiring fault, and swallowing it here would
|
|
170
|
+
// recreate the silent misconfiguration this change exists to end.
|
|
171
|
+
const built = factory(context);
|
|
172
|
+
if (!built) {
|
|
173
|
+
this.ConfigurationRefusal =
|
|
174
|
+
`The transport factory served no transport for credential "${ref}" on driver ` +
|
|
175
|
+
`"${context.DriverClass}".`;
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this.Transport = built;
|
|
179
|
+
this.ConfigurationRefusal = null;
|
|
180
|
+
}
|
|
181
|
+
async FetchRaw(query) {
|
|
182
|
+
// THE TENANT-WIDE REFUSAL IS CHECKED FIRST, matching the message provider. With no transport
|
|
183
|
+
// and no attestation — the default construction — the useful thing to say is WHY live fetch
|
|
184
|
+
// is off, not that a transport is missing. A recorded transport is exempt: the refusal exists
|
|
185
|
+
// to prevent reading calendars we are not scoped to, and a replay reads none.
|
|
186
|
+
if ((this.Transport?.IsLive ?? true) && !this.AllowLiveFetch) {
|
|
187
|
+
const issues = [LIVE_GRAPH_CALENDAR_REFUSAL];
|
|
188
|
+
if (!this.Transport && this.ConfigurationRefusal) {
|
|
189
|
+
// ALSO true, and with a DIFFERENT fix. Reporting only the first sends an operator to
|
|
190
|
+
// chase an Exchange policy when what is missing is a CredentialsRef or a factory.
|
|
191
|
+
issues.push(this.ConfigurationRefusal);
|
|
120
192
|
}
|
|
121
|
-
return {
|
|
122
|
-
Payloads: (response?.Events ?? []),
|
|
123
|
-
Issues: [],
|
|
124
|
-
};
|
|
193
|
+
return { Payloads: [], Issues: issues };
|
|
125
194
|
}
|
|
126
|
-
|
|
127
|
-
return { Payloads: [], Issues: [
|
|
195
|
+
if (!this.Transport) {
|
|
196
|
+
return { Payloads: [], Issues: [this.ConfigurationRefusal ?? NO_CALENDAR_TRANSPORT_REFUSAL] };
|
|
128
197
|
}
|
|
198
|
+
// Deliberately NOT caught. `BaseActivitySyncProvider.Fetch` already distinguishes a throw
|
|
199
|
+
// ("could not look" — Failed, watermark preserved) from an empty batch ("looked, found
|
|
200
|
+
// nothing"). Swallowing a transport failure into an empty batch would report a successful
|
|
201
|
+
// sync of a calendar we never reached, and advance the watermark past it.
|
|
202
|
+
return await this.Transport.Fetch(query);
|
|
129
203
|
}
|
|
130
204
|
Normalize(raw) {
|
|
131
205
|
const items = [];
|
|
@@ -139,7 +213,7 @@ let MSGraphCalendarSyncProvider = class MSGraphCalendarSyncProvider extends Base
|
|
|
139
213
|
};
|
|
140
214
|
MSGraphCalendarSyncProvider = __decorate([
|
|
141
215
|
RegisterClass(BaseActivitySyncProvider, 'Microsoft365.Calendar'),
|
|
142
|
-
__metadata("design:paramtypes", [Boolean, Object])
|
|
216
|
+
__metadata("design:paramtypes", [Boolean, Object, Function])
|
|
143
217
|
], MSGraphCalendarSyncProvider);
|
|
144
218
|
export { MSGraphCalendarSyncProvider };
|
|
145
219
|
//# sourceMappingURL=MSGraphCalendarSyncProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphCalendarSyncProvider.js","sourceRoot":"","sources":["../../src/providers/MSGraphCalendarSyncProvider.ts"],"names":[],"mappings":";;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"MSGraphCalendarSyncProvider.js","sourceRoot":"","sources":["../../src/providers/MSGraphCalendarSyncProvider.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,wBAA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