@transai/connector-runner-microsoft-office365-email 0.1.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +11 -0
  3. package/index.cjs +196 -0
  4. package/index.cjs.map +7 -0
  5. package/index.js +196 -0
  6. package/index.js.map +7 -0
  7. package/libs/connector-runner-microsoft-office365-email/src/index.d.ts +1 -0
  8. package/libs/connector-runner-microsoft-office365-email/src/lib/actions-handler.d.ts +8 -0
  9. package/libs/connector-runner-microsoft-office365-email/src/lib/connector-runner-microsoft-office365-email.d.ts +8 -0
  10. package/libs/connector-runner-microsoft-office365-email/src/lib/mail-processor.d.ts +11 -0
  11. package/libs/connector-runner-microsoft-office365-email/src/lib/types.d.ts +14 -0
  12. package/libs/connector-runtime-sdk/src/index.d.ts +3 -0
  13. package/libs/connector-runtime-sdk/src/lib/connector-runtime.d.ts +16 -0
  14. package/libs/connector-runtime-sdk/src/lib/connector-runtime.interface.d.ts +5 -0
  15. package/libs/connector-runtime-sdk/src/lib/sdk/index.d.ts +7 -0
  16. package/libs/connector-runtime-sdk/src/lib/sdk/logger.sdk.interface.d.ts +7 -0
  17. package/libs/connector-runtime-sdk/src/lib/sdk/offset-store.sdk.interface.d.ts +11 -0
  18. package/libs/connector-runtime-sdk/src/lib/sdk/processing.sdk.interface.d.ts +12 -0
  19. package/libs/connector-runtime-sdk/src/lib/sdk/receiver.sdk.interface.d.ts +14 -0
  20. package/libs/connector-runtime-sdk/src/lib/sdk/sdk.interface.d.ts +16 -0
  21. package/libs/connector-runtime-sdk/src/lib/sdk/sender.sdk.interface.d.ts +22 -0
  22. package/libs/connector-runtime-sdk/src/lib/sdk/templating.sdk.interface.d.ts +12 -0
  23. package/libs/logger/src/index.d.ts +1 -0
  24. package/libs/logger/src/lib/logger.d.ts +28 -0
  25. package/libs/microsoft-office365-mail-client/src/index.d.ts +3 -0
  26. package/libs/microsoft-office365-mail-client/src/lib/mail-client.d.ts +12 -0
  27. package/libs/microsoft-office365-mail-client/src/lib/mail-client.interface.d.ts +7 -0
  28. package/libs/microsoft-office365-mail-client/src/lib/office365-client.d.ts +16 -0
  29. package/libs/microsoft-office365-mail-client/src/lib/office365-mail-parser.d.ts +8 -0
  30. package/libs/microsoft-office365-mail-client/src/lib/office365-types.d.ts +73 -0
  31. package/libs/microsoft-office365-mail-client/src/lib/types.d.ts +46 -0
  32. package/libs/types/src/index.d.ts +7 -0
  33. package/libs/types/src/lib/cube-query-config.types.d.ts +20 -0
  34. package/libs/types/src/lib/file-action.types.d.ts +5 -0
  35. package/libs/types/src/lib/http-status-codes.enum.d.ts +63 -0
  36. package/libs/types/src/lib/management-api/action-definition.interface.d.ts +12 -0
  37. package/libs/types/src/lib/management-api/chart.interface.d.ts +9 -0
  38. package/libs/types/src/lib/management-api/connector/connector.interface.d.ts +140 -0
  39. package/libs/types/src/lib/management-api/connector/connectors.interface.d.ts +126 -0
  40. package/libs/types/src/lib/management-api/connector-orchestrator-config.interface.d.ts +14 -0
  41. package/libs/types/src/lib/management-api/cube-dataset.interface.d.ts +93 -0
  42. package/libs/types/src/lib/management-api/dashboard.interface.d.ts +35 -0
  43. package/libs/types/src/lib/management-api/dataset/collection.interface.d.ts +16 -0
  44. package/libs/types/src/lib/management-api/dataset/dataset-record.interface.d.ts +5 -0
  45. package/libs/types/src/lib/management-api/dataset/dataset.interface.d.ts +730 -0
  46. package/libs/types/src/lib/management-api/dataset/datasets.interface.d.ts +710 -0
  47. package/libs/types/src/lib/management-api/dataset/dimension.interface.d.ts +205 -0
  48. package/libs/types/src/lib/management-api/dataset/dimensions.interface.d.ts +186 -0
  49. package/libs/types/src/lib/management-api/dataset/filter-group.interface.d.ts +8 -0
  50. package/libs/types/src/lib/management-api/dataset/filter.interface.d.ts +34 -0
  51. package/libs/types/src/lib/management-api/dataset/filters.interface.d.ts +7 -0
  52. package/libs/types/src/lib/management-api/dataset/measure.interface.d.ts +65 -0
  53. package/libs/types/src/lib/management-api/dataset/measures.interface.d.ts +56 -0
  54. package/libs/types/src/lib/management-api/dataset/meta.interface.d.ts +9 -0
  55. package/libs/types/src/lib/management-api/dataset/pre-aggregate.interface.d.ts +69 -0
  56. package/libs/types/src/lib/management-api/dataset/pre-aggregations.interface.d.ts +54 -0
  57. package/libs/types/src/lib/management-api/dataset/relation.interface.d.ts +40 -0
  58. package/libs/types/src/lib/management-api/dataset/relations.interface.d.ts +36 -0
  59. package/libs/types/src/lib/management-api/dataset/segment.interface.d.ts +45 -0
  60. package/libs/types/src/lib/management-api/dataset/segments.interface.d.ts +43 -0
  61. package/libs/types/src/lib/management-api/dataset/switch.interface.d.ts +70 -0
  62. package/libs/types/src/lib/management-api/dataset/when-item.interface.d.ts +41 -0
  63. package/libs/types/src/lib/management-api/dataset/when-items.interface.d.ts +40 -0
  64. package/libs/types/src/lib/management-api/event-origin.interface.d.ts +22 -0
  65. package/libs/types/src/lib/management-api/index.d.ts +39 -0
  66. package/libs/types/src/lib/management-api/pagination/index.d.ts +1 -0
  67. package/libs/types/src/lib/management-api/pagination/paginated-response.interface.d.ts +17 -0
  68. package/libs/types/src/lib/management-api/semantic-trigger/index.d.ts +5 -0
  69. package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-filter.interface.d.ts +20 -0
  70. package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-filters.interface.d.ts +18 -0
  71. package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-record.interface.d.ts +6 -0
  72. package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger.interface.d.ts +74 -0
  73. package/libs/types/src/lib/management-api/semantic-trigger/semantic-triggers.interface.d.ts +62 -0
  74. package/libs/types/src/lib/management-api/template-implementation-overrides.interface.d.ts +1152 -0
  75. package/libs/types/src/lib/management-api/template-implementation.interface.d.ts +2860 -0
  76. package/libs/types/src/lib/management-api/template.interface.d.ts +1191 -0
  77. package/libs/types/src/lib/management-api/tenant.interface.d.ts +8 -0
  78. package/libs/types/src/lib/management-api/type-enums.d.ts +85 -0
  79. package/libs/types/src/lib/management-api/workflow/action.interface.d.ts +85 -0
  80. package/libs/types/src/lib/management-api/workflow/index.d.ts +6 -0
  81. package/libs/types/src/lib/management-api/workflow/offset.interface.d.ts +16 -0
  82. package/libs/types/src/lib/management-api/workflow/trigger-types.interface.d.ts +5 -0
  83. package/libs/types/src/lib/management-api/workflow/workflow-definition.interface.d.ts +49 -0
  84. package/libs/types/src/lib/management-api/workflow/workflow-run.d.ts +65 -0
  85. package/libs/types/src/lib/management-api/workflow/workflow.drawing.d.ts +101 -0
  86. package/libs/types/src/lib/message.types.d.ts +59 -0
  87. package/libs/types/src/lib/response.types.d.ts +27 -0
  88. package/libs/types/src/lib/types.d.ts +115 -0
  89. package/package.json +7 -0
@@ -0,0 +1 @@
1
+ export * from './lib/connector-runner-microsoft-office365-email';
@@ -0,0 +1,8 @@
1
+ import { ConnectorSDKInterface } from '@transai/connector-runtime-sdk';
2
+ import { MailClientInterface } from '@xip-online-data/microsoft-office365-mail-client';
3
+ import { KafkaCallbackResponse, XodBaseMessageType } from '@xip-online-data/types';
4
+ export declare class ActionsHandler {
5
+ #private;
6
+ constructor(connectorSDK: ConnectorSDKInterface, mailClient: MailClientInterface);
7
+ get callbackFunctionChain(): (m: XodBaseMessageType) => Promise<KafkaCallbackResponse<unknown>>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ConnectorRuntimeSDK, ConnectorSDKInterface } from '@transai/connector-runtime-sdk';
2
+ import { ConnectorInterface } from '@xip-online-data/types';
3
+ import { ConnectorConfig } from './types';
4
+ export declare class ConnectorRunnerMicrosoftOffice365Email extends ConnectorRuntimeSDK<ConnectorConfig> {
5
+ #private;
6
+ constructor(connector: ConnectorInterface, connectorSDK: ConnectorSDKInterface);
7
+ start: () => Promise<void>;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { ConnectorSDKInterface, IntervalHandler } from '@transai/connector-runtime-sdk';
2
+ import { MailClientInterface } from '@xip-online-data/microsoft-office365-mail-client';
3
+ import { ConnectorConfig, MailboxConfig } from './types';
4
+ export declare class MailProcessor implements IntervalHandler {
5
+ #private;
6
+ readonly DEFAULT_EVENT_TTL = 3600000;
7
+ readonly DEFAULT_INTERVAL_SECONDS = 60;
8
+ readonly MAX_PROCESSING_TRIES = 10;
9
+ constructor(sdk: ConnectorSDKInterface<ConnectorConfig>, config: MailboxConfig, mailClient: MailClientInterface);
10
+ onRun(): Promise<void>;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { MailConfig } from '@xip-online-data/microsoft-office365-mail-client';
2
+ import { BaseConnectorConfig } from '@xip-online-data/types';
3
+ export interface MailboxConfig {
4
+ mailboxIdentifier: string;
5
+ mailbox: string;
6
+ offsetFilePrefix?: string;
7
+ type?: 'metric' | 'document';
8
+ interval?: number;
9
+ limit?: number;
10
+ }
11
+ export interface ConnectorConfig extends BaseConnectorConfig {
12
+ mailboxes: Array<MailboxConfig>;
13
+ mailConfig: MailConfig;
14
+ }
@@ -0,0 +1,3 @@
1
+ export * from './lib/connector-runtime';
2
+ export * from './lib/connector-runtime.interface';
3
+ export * from './lib/sdk';
@@ -0,0 +1,16 @@
1
+ import { KafkaCallbackResponse, BaseConnectorConfig, ActionInterface, ConnectorInterface, XodJobType } from '@xip-online-data/types';
2
+ import { ConnectorRuntimeInterface } from './connector-runtime.interface';
3
+ import { ConnectorSDKInterface } from './sdk';
4
+ export interface IpcMessage {
5
+ cmd: string;
6
+ message: string;
7
+ }
8
+ export declare abstract class ConnectorRuntimeSDK<T extends BaseConnectorConfig = BaseConnectorConfig> implements ConnectorRuntimeInterface {
9
+ #private;
10
+ constructor(connector: ConnectorInterface, connectorSDK: ConnectorSDKInterface);
11
+ init: () => Promise<void>;
12
+ start: () => Promise<void>;
13
+ stop: () => Promise<void>;
14
+ set callbackFunction(callback: (message: XodJobType, action: ActionInterface) => Promise<KafkaCallbackResponse>);
15
+ protected get connectorSDK(): ConnectorSDKInterface<T>;
16
+ }
@@ -0,0 +1,5 @@
1
+ export interface ConnectorRuntimeInterface {
2
+ init(): Promise<void>;
3
+ start(): Promise<void>;
4
+ stop(): Promise<void>;
5
+ }
@@ -0,0 +1,7 @@
1
+ export * from './sdk.interface';
2
+ export * from './logger.sdk.interface';
3
+ export * from './offset-store.sdk.interface';
4
+ export * from './processing.sdk.interface';
5
+ export * from './receiver.sdk.interface';
6
+ export * from './sender.sdk.interface';
7
+ export * from './templating.sdk.interface';
@@ -0,0 +1,7 @@
1
+ export interface LoggerSDKInterface {
2
+ info(...args: Array<unknown>): void;
3
+ debug(...args: Array<unknown>): void;
4
+ error(...args: Array<unknown>): void;
5
+ warn(...args: Array<unknown>): void;
6
+ verbose(...args: Array<unknown>): void;
7
+ }
@@ -0,0 +1,11 @@
1
+ export interface StoredOffset {
2
+ timestamp: number;
3
+ id: number | string;
4
+ isoDate?: string;
5
+ date?: string;
6
+ rawTimestamp?: number | string;
7
+ }
8
+ export interface OffsetStoreSDKInterface {
9
+ getOffset(identifier: string): Promise<StoredOffset>;
10
+ setOffset(offset: StoredOffset, identifier: string): void;
11
+ }
@@ -0,0 +1,12 @@
1
+ export interface IntervalHandler {
2
+ name?: string;
3
+ onRun: () => Promise<void> | void;
4
+ onStop?: () => Promise<void> | void;
5
+ }
6
+ export type RegisterIntervalOptions = {
7
+ immediate?: boolean;
8
+ };
9
+ export interface ProcessingSDKInterface {
10
+ registerInterval(intervalSeconds: number, handler: IntervalHandler, options?: RegisterIntervalOptions): Promise<string>;
11
+ stopInterval(name: string): Promise<void>;
12
+ }
@@ -0,0 +1,14 @@
1
+ import { ActionInterface, KafkaCallbackResponse, KafkaCallbackResponseType, XodJobType } from '@xip-online-data/types';
2
+ export interface ReceiverSDKInterface {
3
+ readonly responses: {
4
+ readonly ok: KafkaCallbackResponseType;
5
+ readonly created: KafkaCallbackResponseType;
6
+ readonly badRequest: KafkaCallbackResponseType;
7
+ readonly unprocessableEntity: KafkaCallbackResponseType;
8
+ readonly notFound: KafkaCallbackResponseType;
9
+ readonly internalServerError: KafkaCallbackResponseType;
10
+ };
11
+ registerCallback<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>, eventType?: string, identifier?: string): void;
12
+ getActionConfig(message: XodJobType): ActionInterface | null;
13
+ emitEventType<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>): (message: T) => Promise<KafkaCallbackResponse>;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseConnectorConfig } from '@xip-online-data/types';
2
+ import { LoggerSDKInterface } from './logger.sdk.interface';
3
+ import { OffsetStoreSDKInterface } from './offset-store.sdk.interface';
4
+ import { ProcessingSDKInterface } from './processing.sdk.interface';
5
+ import { ReceiverSDKInterface } from './receiver.sdk.interface';
6
+ import { SenderSDKInterface } from './sender.sdk.interface';
7
+ import { TemplatingSDKInterface } from './templating.sdk.interface';
8
+ export interface ConnectorSDKInterface<T = BaseConnectorConfig> {
9
+ get config(): T;
10
+ get logger(): LoggerSDKInterface;
11
+ get sender(): SenderSDKInterface;
12
+ get receiver(): ReceiverSDKInterface;
13
+ get templating(): TemplatingSDKInterface;
14
+ get processing(): ProcessingSDKInterface;
15
+ get offsetStore(): OffsetStoreSDKInterface;
16
+ }
@@ -0,0 +1,22 @@
1
+ export interface Metric {
2
+ key: string;
3
+ value: number;
4
+ }
5
+ export type Metadata = {
6
+ [key: string]: string;
7
+ };
8
+ export interface Context {
9
+ timestamp?: Date;
10
+ ttl?: number;
11
+ extraPayload?: {
12
+ [key: string]: string;
13
+ };
14
+ }
15
+ export type Result = boolean | {
16
+ [index: number]: boolean;
17
+ };
18
+ export interface SenderSDKInterface {
19
+ metrics(metrics: Array<Metric>, metadata?: Metadata, context?: Context): Promise<Result>;
20
+ metricsLegacy(metrics: Array<never>, metadata?: Metadata, context?: Context): Promise<Result>;
21
+ documents(metrics: Array<object>, metadata?: Metadata, context?: Context): Promise<Result>;
22
+ }
@@ -0,0 +1,12 @@
1
+ export type RuntimeOptions = {
2
+ partial?: boolean;
3
+ };
4
+ export type CompileDelegate<T = unknown> = {
5
+ (context: T, options?: RuntimeOptions): string;
6
+ };
7
+ export type CompileOptions = {
8
+ strict?: boolean;
9
+ };
10
+ export interface TemplatingSDKInterface {
11
+ compile<T = unknown>(input: string, options?: CompileOptions): CompileDelegate<T>;
12
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/logger';
@@ -0,0 +1,28 @@
1
+ export declare enum LogLevels {
2
+ error = "error",
3
+ warn = "warn",
4
+ info = "info",
5
+ http = "http",
6
+ debug = "debug"
7
+ }
8
+ export declare class Logger {
9
+ #private;
10
+ private static instance;
11
+ private readonly logger;
12
+ constructor(identifier?: string, loglevel?: LogLevels);
13
+ static getInstance(identifier?: string, loglevel?: LogLevels): Logger;
14
+ setDatadogTransport(context?: {
15
+ service?: string;
16
+ env?: string;
17
+ source?: string;
18
+ tags?: {
19
+ [tag: string]: string;
20
+ };
21
+ apiKey?: string;
22
+ }): Logger;
23
+ info(...args: Array<unknown>): void;
24
+ debug(...args: Array<unknown>): void;
25
+ error(...args: Array<unknown>): void;
26
+ warn(...args: Array<unknown>): void;
27
+ verbose(...args: Array<unknown>): void;
28
+ }
@@ -0,0 +1,3 @@
1
+ export * from './lib/mail-client.interface';
2
+ export * from './lib/mail-client';
3
+ export * from './lib/types';
@@ -0,0 +1,12 @@
1
+ import { MailClientInterface } from './mail-client.interface';
2
+ import { Office365Client } from './office365-client';
3
+ import { Office365MailParser } from './office365-mail-parser';
4
+ import { MailConfig, MailMessage } from './types';
5
+ export declare class MailClient implements MailClientInterface {
6
+ #private;
7
+ constructor(config: MailConfig, office365Client?: Office365Client, office365Parser?: Office365MailParser);
8
+ readMailbox(mailbox: string, lastSeenTimestamp?: number, lastSeenId?: string, limit?: number): Promise<Array<MailMessage>>;
9
+ reply(messageId: string, from: string, body: string, concept?: boolean): Promise<void>;
10
+ addCategory(messageId: string, ...category: Array<string>): Promise<void>;
11
+ removeCategory(messageId: string, ...category: Array<string>): Promise<void>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { MailMessage } from './types';
2
+ export interface MailClientInterface {
3
+ readMailbox(mailbox: string, lastSeenTimestamp?: number, lastSeenId?: string, limit?: number): Promise<Array<MailMessage>>;
4
+ reply(messageId: string, from: string, body: string, concept?: boolean): Promise<void>;
5
+ addCategory(messageId: string, ...category: Array<string>): Promise<void>;
6
+ removeCategory(messageId: string, ...category: Array<string>): Promise<void>;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { ParsedMail } from 'mailparser';
2
+ import { Office365Folder, Office365Mail, Office365MailCategories } from './office365-types';
3
+ export declare class Office365Client {
4
+ #private;
5
+ constructor(userPrincipalName: string, emlTestMode?: boolean);
6
+ init(tenantId: string, clientId: string, clientSecret: string): Promise<void>;
7
+ getFolder(displayName: string, topMailboxes?: number): Promise<Office365Folder | null>;
8
+ getMail(messageId: string): Promise<Office365Mail | null>;
9
+ getMails(folderId: string, limit?: number, fromEpochMs?: number): Promise<Array<Office365Mail>>;
10
+ getFullMail(folderId: string, mailId: string): Promise<ParsedMail>;
11
+ getMailCategories(messageId: string): Promise<Office365MailCategories>;
12
+ updateMailCategories(messageId: string, categories: Office365MailCategories): Promise<void>;
13
+ createReply(messageId: string, body?: string, from?: string): Promise<Office365Mail>;
14
+ sendMail(messageId: string): Promise<void>;
15
+ moveMailToFolder(messageId: string, folderId: string): Promise<void>;
16
+ }
@@ -0,0 +1,8 @@
1
+ import { ParsedMail } from 'mailparser';
2
+ import { Office365Mail } from './office365-types';
3
+ import { MailMessage } from './types';
4
+ export declare class Office365MailParser {
5
+ #private;
6
+ parsedToMailMessage(mail: Office365Mail, parsed: ParsedMail, receivedFallback: Date): Promise<MailMessage>;
7
+ formatMailReplyBody(orig: Office365Mail, body: string): string;
8
+ }
@@ -0,0 +1,73 @@
1
+ export type Office365Folder = {
2
+ id: string;
3
+ displayName?: string;
4
+ };
5
+ export type Office365FolderList = {
6
+ value?: Array<Office365Folder>;
7
+ };
8
+ export type Office365Mail = {
9
+ id: string;
10
+ internetMessageId?: string;
11
+ subject?: string;
12
+ receivedDateTime?: string;
13
+ sentDateTime?: string;
14
+ lastModifiedDateTime?: string;
15
+ body?: {
16
+ contentType: 'Text' | 'HTML';
17
+ content: string;
18
+ };
19
+ bodyPreview?: string;
20
+ from?: {
21
+ emailAddress: {
22
+ address?: string;
23
+ };
24
+ };
25
+ replyTo?: Array<{
26
+ emailAddress: {
27
+ address?: string;
28
+ };
29
+ }>;
30
+ toRecipients?: Array<{
31
+ emailAddress: {
32
+ address?: string;
33
+ };
34
+ }>;
35
+ ccRecipients?: Array<{
36
+ emailAddress: {
37
+ address?: string;
38
+ };
39
+ }>;
40
+ bccRecipients?: Array<{
41
+ emailAddress: {
42
+ address?: string;
43
+ };
44
+ }>;
45
+ internetMessageHeaders?: Array<{
46
+ name: string;
47
+ value: string;
48
+ }>;
49
+ };
50
+ export type Office365MailList = {
51
+ value?: Array<Office365Mail>;
52
+ '@odata.nextLink'?: string;
53
+ };
54
+ export type Office365MailCategories = {
55
+ categories?: Array<string>;
56
+ };
57
+ export type Office365MailAttachment = {
58
+ id: string;
59
+ contentType?: 'message/rfc822' | string;
60
+ name?: string;
61
+ fileName?: string;
62
+ contentBytes?: unknown;
63
+ '@odata.type': '#microsoft.graph.fileAttachment' | '#microsoft.graph.itemAttachment' | string;
64
+ item?: {
65
+ '@odata.type': '#microsoft.graph.message' | string;
66
+ };
67
+ };
68
+ export type Office365MailAttachmentList = {
69
+ value?: Array<Office365MailAttachment>;
70
+ '@odata.nextLink'?: string;
71
+ };
72
+ export declare const WELL_KNOWN_EMAIL_BOXES: string[];
73
+ export declare const EMAIL_SELECTABLE_FIELD: string[];
@@ -0,0 +1,46 @@
1
+ export interface MailConfig {
2
+ username: string;
3
+ tenantId?: string;
4
+ clientId?: string;
5
+ clientSecret?: string;
6
+ emlTestMode?: boolean;
7
+ }
8
+ export interface MailAttachment {
9
+ content?: string;
10
+ text?: string;
11
+ contentType: string;
12
+ filename?: string;
13
+ path?: string;
14
+ }
15
+ export interface MailMessage {
16
+ /**
17
+ * Surrogate, monotonic per sync: Graph lastModifiedDateTime as epoch ms.
18
+ * This advances on moves/edits so backfills (e.g. moving old mail to Inbox)
19
+ * are detected on the next run.
20
+ */
21
+ deltaTimestamp: number;
22
+ deltaId: string;
23
+ attachments?: Array<MailAttachment>;
24
+ headers?: Array<{
25
+ key: string;
26
+ header: string;
27
+ }>;
28
+ headerLines?: Array<{
29
+ key: string;
30
+ line: string;
31
+ }>;
32
+ subject?: string;
33
+ references?: string | Array<string>;
34
+ date?: Date;
35
+ to?: Array<string>;
36
+ from?: Array<string>;
37
+ cc?: Array<string>;
38
+ bcc?: Array<string>;
39
+ messageId?: string;
40
+ inReplyTo?: string;
41
+ replyTo?: Array<string>;
42
+ text?: string;
43
+ html?: string;
44
+ textAsHtml?: string;
45
+ originalMessageId?: string;
46
+ }
@@ -0,0 +1,7 @@
1
+ export * from './lib/types';
2
+ export * from './lib/response.types';
3
+ export * from './lib/message.types';
4
+ export * from './lib/cube-query-config.types';
5
+ export * from './lib/file-action.types';
6
+ export * from './lib/management-api';
7
+ export * from './lib/http-status-codes.enum';
@@ -0,0 +1,20 @@
1
+ import { Query } from '@cubejs-client/core';
2
+ export interface CubeQueryConfig {
3
+ tenantId: string;
4
+ query: Query;
5
+ nullable?: boolean;
6
+ subqueries: Array<CubeSubQueryConfig>;
7
+ }
8
+ export interface CubeSubQueryConfig {
9
+ tenantId?: string;
10
+ query: Query;
11
+ nullable?: boolean;
12
+ field: string;
13
+ joinConditions: Array<CubeJoinCondition>;
14
+ }
15
+ export interface CubeJoinCondition {
16
+ selectField: string;
17
+ operator: string;
18
+ valueField: Array<string>;
19
+ valueMap?: Array<any>;
20
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum FileActionType {
2
+ ACTION_MOVE = "move",
3
+ ACTION_DELETE = "delete",
4
+ ACTION_NOTHING = "nothing"
5
+ }
@@ -0,0 +1,63 @@
1
+ export declare enum HttpStatusCode {
2
+ Continue = 100,
3
+ SwitchingProtocols = 101,
4
+ Processing = 102,
5
+ OK = 200,
6
+ Created = 201,
7
+ Accepted = 202,
8
+ NonAuthoritativeInformation = 203,
9
+ NoContent = 204,
10
+ ResetContent = 205,
11
+ PartialContent = 206,
12
+ MultiStatus = 207,
13
+ AlreadyReported = 208,
14
+ IMUsed = 226,
15
+ MultipleChoices = 300,
16
+ MovedPermanently = 301,
17
+ Found = 302,
18
+ SeeOther = 303,
19
+ NotModified = 304,
20
+ UseProxy = 305,
21
+ TemporaryRedirect = 307,
22
+ PermanentRedirect = 308,
23
+ BadRequest = 400,
24
+ Unauthorized = 401,
25
+ PaymentRequired = 402,
26
+ Forbidden = 403,
27
+ NotFound = 404,
28
+ MethodNotAllowed = 405,
29
+ NotAcceptable = 406,
30
+ ProxyAuthenticationRequired = 407,
31
+ RequestTimeout = 408,
32
+ Conflict = 409,
33
+ Gone = 410,
34
+ LengthRequired = 411,
35
+ PreconditionFailed = 412,
36
+ PayloadTooLarge = 413,
37
+ URITooLong = 414,
38
+ UnsupportedMediaType = 415,
39
+ RangeNotSatisfiable = 416,
40
+ ExpectationFailed = 417,
41
+ ImATeapot = 418,
42
+ MisdirectedRequest = 421,
43
+ UnprocessableEntity = 422,
44
+ Locked = 423,
45
+ FailedDependency = 424,
46
+ TooEarly = 425,
47
+ UpgradeRequired = 426,
48
+ PreconditionRequired = 428,
49
+ TooManyRequests = 429,
50
+ RequestHeaderFieldsTooLarge = 431,
51
+ UnavailableForLegalReasons = 451,
52
+ InternalServerError = 500,
53
+ NotImplemented = 501,
54
+ BadGateway = 502,
55
+ ServiceUnavailable = 503,
56
+ GatewayTimeout = 504,
57
+ HTTPVersionNotSupported = 505,
58
+ VariantAlsoNegotiates = 506,
59
+ InsufficientStorage = 507,
60
+ LoopDetected = 508,
61
+ NotExtended = 510,
62
+ NetworkAuthenticationRequired = 511
63
+ }
@@ -0,0 +1,12 @@
1
+ import { TenantInterface } from './tenant.interface';
2
+ import { CubeQueryConfig } from '../cube-query-config.types';
3
+ export interface ActionDefinitionInterface {
4
+ tenant: TenantInterface;
5
+ eventType: string;
6
+ eventTopic: string;
7
+ destinationTopic: string;
8
+ actionIdentifier: string;
9
+ template: string;
10
+ fileNameTemplate: string | undefined;
11
+ queryConfig: CubeQueryConfig | undefined;
12
+ }
@@ -0,0 +1,9 @@
1
+ export interface ChartInterface {
2
+ dashboards: Array<number>;
3
+ owners: Array<number>;
4
+ params: string;
5
+ slice_name: string;
6
+ viz_type: string;
7
+ id: string;
8
+ supersetId: number;
9
+ }