@worknice/js-sdk 0.13.10 → 0.13.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/{_types-BiXOGWxp.d.ts → _types-CeswTuBG.d.ts} +1 -0
- package/dist/api/WorkniceIntegrationLogger.d.ts +17 -5
- package/dist/api/WorkniceIntegrationLogger.js +28 -11
- package/dist/api/WorkniceIntegrationLogger.js.map +1 -1
- package/dist/api/_generated.d.ts +2 -0
- package/dist/api/_generated.js.map +1 -1
- package/dist/api/_types.d.ts +1 -1
- package/dist/api/_types.js.map +1 -1
- package/dist/api/createApiOperation.d.ts +1 -1
- package/dist/api/createWorkniceClient.d.ts +1 -1
- package/dist/api/createWorkniceClient.js +5 -5
- package/dist/api/createWorkniceClient.js.map +1 -1
- package/dist/api/operations/activateIntegration.d.ts +1 -1
- package/dist/api/operations/authorizeIntegration.d.ts +1 -1
- package/dist/api/operations/completeSync.d.ts +1 -1
- package/dist/api/operations/createApiToken.d.ts +1 -1
- package/dist/api/operations/createDataImport.d.ts +1 -1
- package/dist/api/operations/createLeaveRequest.d.ts +1 -1
- package/dist/api/operations/createPerson.d.ts +1 -1
- package/dist/api/operations/createPersonConnection.d.ts +1 -1
- package/dist/api/operations/createPersonDataImportLine.d.ts +1 -1
- package/dist/api/operations/deleteApiToken.d.ts +1 -1
- package/dist/api/operations/deletePersonConnection.d.ts +1 -1
- package/dist/api/operations/getApiTokens.d.ts +1 -1
- package/dist/api/operations/getIntegration.d.ts +1 -1
- package/dist/api/operations/getLeaveRequests.d.ts +1 -1
- package/dist/api/operations/getMyApps.d.ts +1 -1
- package/dist/api/operations/getPeople.d.ts +1 -1
- package/dist/api/operations/getPersonConnections.d.ts +1 -1
- package/dist/api/operations/initializeIntegration.d.ts +1 -1
- package/dist/api/operations/updateLeaveRequest.d.ts +1 -1
- package/dist/api/operations/updatePerson.d.ts +1 -1
- package/dist/api/operations/updatePersonConnection.d.ts +1 -1
- package/dist/helpers/_types.d.ts +1 -1
- package/dist/helpers/handleApproveLeaveRequestWebhook.d.ts +3 -3
- package/dist/helpers/handleCancelLeaveRequestWebhook.d.ts +3 -3
- package/dist/helpers/handleCreateIntegrationWebhook.d.ts +2 -2
- package/dist/helpers/handleCreateLeaveRequestWebhook.d.ts +3 -3
- package/dist/helpers/handleDenyLeaveRequestWebhook.d.ts +3 -3
- package/dist/helpers/handleGetAuthorizationUrlWebhook.d.ts +2 -2
- package/dist/helpers/handleGetConfigurationUrlWebhook.d.ts +2 -2
- package/dist/helpers/handleGetLeaveBalancesWebhook.d.ts +2 -2
- package/dist/helpers/handleGetLeaveCategoriesWebhook.d.ts +3 -3
- package/dist/helpers/handleGetLeaveRequestHoursWebhook.d.ts +2 -2
- package/dist/helpers/handleGetOpenUrlWebhook.d.ts +2 -2
- package/dist/helpers/handleIntegrationArchivedWebhook.d.ts +2 -2
- package/dist/helpers/handlePersonConnectedWebhook.d.ts +2 -2
- package/dist/helpers/handleProcessLeaveRequestWebhook.d.ts +3 -3
- package/dist/helpers/handleRequest.d.ts +2 -2
- package/dist/helpers/handleRequest.js +64 -47
- package/dist/helpers/handleRequest.js.map +1 -1
- package/dist/helpers/handleRequestWithWorknice.d.ts +2 -2
- package/dist/helpers/handleRequestWithWorknice.js +3 -0
- package/dist/helpers/handleRequestWithWorknice.js.map +1 -1
- package/dist/helpers/handleTriggerIntegrationSyncWebhook.d.ts +2 -2
- package/dist/helpers/index.d.ts +1 -1
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WorkniceClient } from '../_types-
|
|
1
|
+
import { W as WorkniceClient } from '../_types-CeswTuBG.js';
|
|
2
2
|
import './_generated.js';
|
|
3
3
|
|
|
4
4
|
type Logger = Pick<Console, "debug" | "error" | "info" | "warn"> & Partial<Pick<Console, "group" | "groupEnd">>;
|
|
@@ -22,6 +22,10 @@ type WorkniceIntegrationLoggerOptions = {
|
|
|
22
22
|
* A Console-like object with which messages will be logger.
|
|
23
23
|
*/
|
|
24
24
|
logger: Logger;
|
|
25
|
+
/**
|
|
26
|
+
* The correlation ID to include in all log messages.
|
|
27
|
+
*/
|
|
28
|
+
correlationId?: string;
|
|
25
29
|
};
|
|
26
30
|
/**
|
|
27
31
|
* A logger that can log messages to both a Console-like object and to a
|
|
@@ -62,9 +66,11 @@ declare class WorkniceIntegrationLogger {
|
|
|
62
66
|
*/
|
|
63
67
|
private integrationId;
|
|
64
68
|
/**
|
|
65
|
-
* The
|
|
69
|
+
* The ID for the integration log to which the logs will be appended.
|
|
70
|
+
* This is set to the same value as correlationId to enable easy tracing
|
|
71
|
+
* between integration logs visible to users and platform logs in Axiom.
|
|
66
72
|
*/
|
|
67
|
-
|
|
73
|
+
readonly integrationLogId: string;
|
|
68
74
|
/**
|
|
69
75
|
* Determines when the logger should flush the logs. Calling info(), error(),
|
|
70
76
|
* warn(), indent() or dedent() will automatically flush the logs if the last
|
|
@@ -95,12 +101,18 @@ declare class WorkniceIntegrationLogger {
|
|
|
95
101
|
* @param options.debugLogType The type of console logging to use for debug messages. Defaults to "debug".
|
|
96
102
|
* @param options.delayBetweenFlushes The delay between flushes in milliseconds. Defaults to 1000 (1 second).
|
|
97
103
|
* @param options.logger A Console-like object with which messages can be logged. Defaults to the global console object.
|
|
104
|
+
* @param options.correlationId The correlation ID to include in all log messages.
|
|
98
105
|
* @example
|
|
99
106
|
* ```js
|
|
100
|
-
* const logger = new WorkniceIntegrationLogger({ logger: console });
|
|
107
|
+
* const logger = new WorkniceIntegrationLogger({ logger: console, correlationId: "abc123" });
|
|
101
108
|
* ```
|
|
102
109
|
*/
|
|
103
110
|
constructor(options?: Partial<WorkniceIntegrationLoggerOptions>);
|
|
111
|
+
/**
|
|
112
|
+
* Gets the correlation ID for this logger session.
|
|
113
|
+
* This will always return a value as correlationId is set during initialization.
|
|
114
|
+
*/
|
|
115
|
+
get correlationId(): string;
|
|
104
116
|
/**
|
|
105
117
|
* Connects the logger to a Worknice integration. If there are previously
|
|
106
118
|
* logged messages that need to be flushed, a new integration log will be
|
|
@@ -118,7 +130,7 @@ declare class WorkniceIntegrationLogger {
|
|
|
118
130
|
/**
|
|
119
131
|
* Logs an error of any type. The error will be logged to the configured logger
|
|
120
132
|
* with full stack traces and a chain of error causes. A simplified error
|
|
121
|
-
* message will sent to the Worknice integration logs (if connected) and
|
|
133
|
+
* message will be sent to the Worknice integration logs (if connected) and
|
|
122
134
|
* returned for displaying to the user. If the error is not an instance of
|
|
123
135
|
* Error, it will be coerced into a string before being logged.
|
|
124
136
|
*/
|
|
@@ -20,7 +20,9 @@ class WorkniceIntegrationLogger {
|
|
|
20
20
|
*/
|
|
21
21
|
integrationId = void 0;
|
|
22
22
|
/**
|
|
23
|
-
* The
|
|
23
|
+
* The ID for the integration log to which the logs will be appended.
|
|
24
|
+
* This is set to the same value as correlationId to enable easy tracing
|
|
25
|
+
* between integration logs visible to users and platform logs in Axiom.
|
|
24
26
|
*/
|
|
25
27
|
integrationLogId;
|
|
26
28
|
/**
|
|
@@ -53,19 +55,29 @@ class WorkniceIntegrationLogger {
|
|
|
53
55
|
* @param options.debugLogType The type of console logging to use for debug messages. Defaults to "debug".
|
|
54
56
|
* @param options.delayBetweenFlushes The delay between flushes in milliseconds. Defaults to 1000 (1 second).
|
|
55
57
|
* @param options.logger A Console-like object with which messages can be logged. Defaults to the global console object.
|
|
58
|
+
* @param options.correlationId The correlation ID to include in all log messages.
|
|
56
59
|
* @example
|
|
57
60
|
* ```js
|
|
58
|
-
* const logger = new WorkniceIntegrationLogger({ logger: console });
|
|
61
|
+
* const logger = new WorkniceIntegrationLogger({ logger: console, correlationId: "abc123" });
|
|
59
62
|
* ```
|
|
60
63
|
*/
|
|
61
64
|
constructor(options) {
|
|
62
|
-
|
|
65
|
+
const correlationId = options?.correlationId?.trim() || uuid();
|
|
66
|
+
this.integrationLogId = correlationId;
|
|
63
67
|
this.options = {
|
|
64
68
|
debugLogType: options?.debugLogType ?? "debug",
|
|
65
69
|
delayBetweenFlushes: options?.delayBetweenFlushes ?? 1e3,
|
|
66
|
-
logger: options?.logger ?? console
|
|
70
|
+
logger: options?.logger ?? console,
|
|
71
|
+
correlationId
|
|
67
72
|
};
|
|
68
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Gets the correlation ID for this logger session.
|
|
76
|
+
* This will always return a value as correlationId is set during initialization.
|
|
77
|
+
*/
|
|
78
|
+
get correlationId() {
|
|
79
|
+
return this.options.correlationId;
|
|
80
|
+
}
|
|
69
81
|
/**
|
|
70
82
|
* Connects the logger to a Worknice integration. If there are previously
|
|
71
83
|
* logged messages that need to be flushed, a new integration log will be
|
|
@@ -82,8 +94,10 @@ class WorkniceIntegrationLogger {
|
|
|
82
94
|
* and are never sent to the Worknice integration logs.
|
|
83
95
|
*/
|
|
84
96
|
debug(message) {
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
const meta = { correlationId: this.options.correlationId };
|
|
98
|
+
if (this.options.debugLogType === "debug") {
|
|
99
|
+
this.options.logger.debug(message, meta);
|
|
100
|
+
} else this.options.logger.info(message, meta);
|
|
87
101
|
}
|
|
88
102
|
dedent(message) {
|
|
89
103
|
if (message !== void 0) this.info(message);
|
|
@@ -108,7 +122,7 @@ class WorkniceIntegrationLogger {
|
|
|
108
122
|
/**
|
|
109
123
|
* Logs an error of any type. The error will be logged to the configured logger
|
|
110
124
|
* with full stack traces and a chain of error causes. A simplified error
|
|
111
|
-
* message will sent to the Worknice integration logs (if connected) and
|
|
125
|
+
* message will be sent to the Worknice integration logs (if connected) and
|
|
112
126
|
* returned for displaying to the user. If the error is not an instance of
|
|
113
127
|
* Error, it will be coerced into a string before being logged.
|
|
114
128
|
*/
|
|
@@ -121,7 +135,8 @@ class WorkniceIntegrationLogger {
|
|
|
121
135
|
format: "simple",
|
|
122
136
|
stack: false
|
|
123
137
|
});
|
|
124
|
-
this.options.
|
|
138
|
+
const meta = { correlationId: this.options.correlationId };
|
|
139
|
+
this.options.logger.error(verboseMessage, meta);
|
|
125
140
|
this.enqueue(simpleMessage);
|
|
126
141
|
return simpleMessage;
|
|
127
142
|
}
|
|
@@ -162,7 +177,7 @@ class WorkniceIntegrationLogger {
|
|
|
162
177
|
`,
|
|
163
178
|
{
|
|
164
179
|
// Only create a new log the first time the logger is flushed.
|
|
165
|
-
createNewLog: this.logCreated
|
|
180
|
+
createNewLog: !this.logCreated,
|
|
166
181
|
entries,
|
|
167
182
|
integrationId: this.integrationId,
|
|
168
183
|
integrationLogId: this.integrationLogId
|
|
@@ -182,14 +197,16 @@ class WorkniceIntegrationLogger {
|
|
|
182
197
|
* logger and flushed to the Worknice integration logs if/when connected.
|
|
183
198
|
*/
|
|
184
199
|
info(message) {
|
|
185
|
-
this.options.
|
|
200
|
+
const meta = { correlationId: this.options.correlationId };
|
|
201
|
+
this.options.logger.info(message, meta);
|
|
186
202
|
this.enqueue(message);
|
|
187
203
|
}
|
|
188
204
|
timeSinceLastFlush() {
|
|
189
205
|
return this.lastFlush === null ? Number.MAX_SAFE_INTEGER : Temporal.Now.instant().since(this.lastFlush).total("milliseconds");
|
|
190
206
|
}
|
|
191
207
|
warn(message) {
|
|
192
|
-
this.options.
|
|
208
|
+
const meta = { correlationId: this.options.correlationId };
|
|
209
|
+
this.options.logger.warn(message, meta);
|
|
193
210
|
this.enqueue(message);
|
|
194
211
|
}
|
|
195
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/WorkniceIntegrationLogger.ts"],"sourcesContent":["import gql from \"dedent\";\nimport { Temporal } from \"temporal-polyfill\";\nimport { v4 as uuid } from \"uuid\";\n\nimport errorToString from \"../utils/errorToString.js\";\nimport type { WorkniceClient } from \"./_types.js\";\n\nexport type Logger = Pick<Console, \"debug\" | \"error\" | \"info\" | \"warn\"> &\n Partial<Pick<Console, \"group\" | \"groupEnd\">>;\n\nexport type WorkniceIntegrationLoggerOptions = {\n /**\n * The type of log to use for debug messages. If set to \"debug\", debug\n * messages will be logged using the logger.debug() method, but if set to\n * \"info\", debug messages will be logged using the logger.info() method.\n *\n * Irrespective of this option, debug messages are only logged to the\n * configured logger and are never sent to the Worknice integration logs.\n *\n * Defaults to \"debug\".\n */\n debugLogType: \"debug\" | \"info\";\n\n /**\n * The delay between flushes in milliseconds. Defaults to 1000 (1 second).\n */\n delayBetweenFlushes: number;\n\n /**\n * A Console-like object with which messages will be logger.\n */\n logger: Logger;\n};\n\n/**\n * A logger that can log messages to both a Console-like object and to a\n * Worknice integration's logs which can be viewed by a Worknice user.\n *\n * By default, messages are only logged to the configured logger, but when a\n * Worknice integration is connected using the connect() method, the messages\n * will also be sent to the Worknice integration logs.\n *\n * @example\n * ```js\n * const logger = new WorkniceIntegrationLogger();\n * logger.info(\"Hello, World!\");\n * logger.debug(\"This message will only be logged to the console.\");\n * logger.error(Error(\"This is an error message.\")); // full stack traces are logged to the console, but only the error message is sent to Worknice\n * logger.connect(workniceClient, integrationId); // connect the logger to a Worknice integration (can be done at any time, messages are buffered until the logger is connected)\n * logger.indent(\"Hello again!\"); // subsequent messages will be indented\n * logger.info(\"This message is indented.\"); // indented\n * logger.dedent(\"Goodbye!\"); // indented, subsequent messages will not be indented\n * await logger.flush(); // sends any unsent messages to Worknice (should be called at the end of the script to ensure all messages are sent)\n * ```\n */\nclass WorkniceIntegrationLogger {\n /**\n * The Worknice client used to send the logs to the server. If null, the logs\n * will be buffered until the logger is initialized.\n */\n private client: WorkniceClient | null = null;\n\n /**\n * A promise used to ensure that only one request is in progress at a time. If\n * a flush is called while a request is in progress, the flush will wait for\n * the request to finish before starting a new one.\n */\n private currentRequest: Promise<unknown> | null = null;\n\n /**\n * The integration ID the logs will be associated with. If undefined, the\n * logs will be buffered until the logger has been initialized.\n */\n private integrationId: string | undefined = undefined;\n\n /**\n * The random ID for the integration log to which the logs will be appended.\n */\n private integrationLogId: string;\n\n /**\n * Determines when the logger should flush the logs. Calling info(), error(),\n * warn(), indent() or dedent() will automatically flush the logs if the last\n * flush was more than 1 second ago.\n */\n private lastFlush: Temporal.Instant | null = null;\n\n /**\n * A flag is used to determine whether a new log should be created when the\n * logger is flushed. The first time the logger is flushed, a new log will be\n * created. Subsequent flushes will append to the existing log.\n */\n private logCreated = false;\n\n /**\n * Backlog of log messages that have not yet been sent to Worknice. The logs\n * will be sent to the server when the logger is flushed and the backlog will\n * be cleared.\n */\n private logs: Array<{ time: Temporal.Instant; message: string }> = [];\n\n /**\n * Determines the current indentation level of the log messages. The indent()\n * and dedent() functions can be used to increase or decrease the indentation\n * level.\n */\n private messageIndent = 0;\n\n private options: WorkniceIntegrationLoggerOptions;\n\n private timeout: NodeJS.Timeout | null = null;\n\n /**\n * @param options.debugLogType The type of console logging to use for debug messages. Defaults to \"debug\".\n * @param options.delayBetweenFlushes The delay between flushes in milliseconds. Defaults to 1000 (1 second).\n * @param options.logger A Console-like object with which messages can be logged. Defaults to the global console object.\n * @example\n * ```js\n * const logger = new WorkniceIntegrationLogger({ logger: console });\n * ```\n */\n constructor(options?: Partial<WorkniceIntegrationLoggerOptions>) {\n this.integrationLogId = uuid();\n this.options = {\n debugLogType: options?.debugLogType ?? \"debug\",\n delayBetweenFlushes: options?.delayBetweenFlushes ?? 1000,\n logger: options?.logger ?? console,\n };\n }\n\n /**\n * Connects the logger to a Worknice integration. If there are previously\n * logged messages that need to be flushed, a new integration log will be\n * instantly created and the messages flushed to it. Otherwise, an integration\n * log will be created if/when the first message is logged.\n */\n public connect(client: WorkniceClient, integrationId: string) {\n this.client = client;\n this.integrationId = integrationId;\n this.flush();\n }\n\n /**\n * Logs a debug message. Debug messages are only logged to the configured logger\n * and are never sent to the Worknice integration logs.\n */\n public debug(message: string) {\n if (this.options.debugLogType === \"debug\") this.options.logger.debug(message);\n else this.options.logger.info(message);\n }\n\n public dedent(message?: string) {\n if (message !== undefined) this.info(message);\n if (this.options.logger.groupEnd) this.options.logger.groupEnd();\n this.messageIndent = Math.max(0, this.messageIndent - 1);\n }\n\n private enqueue(message: string) {\n this.logs.push({\n time: Temporal.Now.instant(),\n message: message\n .split(\"\\n\")\n .map((line) => `${\" \".repeat(this.messageIndent * 2)}${line}`)\n .join(\"\\n\"),\n });\n\n // If the last flush was more than the delay between flushes, flush the logs\n // immediately. Otherwise, schedule a new flush unless one is already\n // scheduled.\n if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {\n this.flush();\n } else if (this.timeout === null) {\n this.timeout = setTimeout(() => {\n if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {\n this.flush();\n }\n }, this.options.delayBetweenFlushes - this.timeSinceLastFlush());\n }\n }\n\n /**\n * Logs an error of any type. The error will be logged to the configured logger\n * with full stack traces and a chain of error causes. A simplified error\n * message will sent to the Worknice integration logs (if connected) and\n * returned for displaying to the user. If the error is not an instance of\n * Error, it will be coerced into a string before being logged.\n */\n public error(error: unknown) {\n const verboseMessage = errorToString(error, {\n format: \"chain\",\n stack: true,\n });\n\n const simpleMessage = errorToString(error, {\n format: \"simple\",\n stack: false,\n });\n\n this.options.logger.error(verboseMessage);\n this.enqueue(simpleMessage);\n\n return simpleMessage;\n }\n\n /**\n * Flushes the log buffer to the server. The info() function will\n * automatically flush the logs if the last flush was more than 1 second\n * ago, but the flush() function should be called manually at the end of the\n * script to ensure that all logs are sent to the server.\n */\n public async flush() {\n // Clear any scheduled flushes.\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n // Update the last flush time to the current time so that any calls to\n // enqueue will not unnecessarily try to flush the logs again.\n this.lastFlush = Temporal.Now.instant();\n\n // If there's already a request in progress, wait for it to finish before\n // starting a new one.\n if (this.currentRequest) await this.currentRequest;\n\n // If there are no pending logs or the logger hasn't been initialized,\n // don't do anything (any logs will remain in the buffer until the next\n // flush).\n if (this.logs.length === 0 || this.client === null || this.integrationId === null) return;\n\n const entries = this.logs.splice(0).map(({ time, message }) => ({\n time: time.toString({ timeZone: \"Australia/Sydney\", smallestUnit: \"second\" }),\n message,\n }));\n\n this.currentRequest = this.client.fetchFromApi(\n gql`\n mutation AppendIntegrationLog(\n $createNewLog: Boolean!\n $entries: [IntegrationLogInput!]!\n $integrationId: ID!\n $integrationLogId: ID!\n ) {\n createIntegrationLog(integrationId: $integrationId, integrationLogId: $integrationLogId)\n @include(if: $createNewLog) {\n id\n }\n appendIntegrationLog(integrationLogId: $integrationLogId, entries: $entries) {\n id\n }\n }\n `,\n {\n // Only create a new log the first time the logger is flushed.\n createNewLog: this.logCreated === false,\n entries,\n integrationId: this.integrationId,\n integrationLogId: this.integrationLogId,\n },\n );\n\n // Only create a new log the first time the logger is flushed.\n this.logCreated = true;\n\n await this.currentRequest;\n\n // Clear the request promise so that the next flush can start a new request.\n this.currentRequest = null;\n }\n\n public indent(message?: string) {\n if (message !== undefined) this.info(message);\n if (this.options.logger.group) this.options.logger.group();\n this.messageIndent += 1;\n }\n\n /**\n * Logs an informational message. The message will be logged to the configured\n * logger and flushed to the Worknice integration logs if/when connected.\n */\n public info(message: string) {\n this.options.logger.info(message);\n this.enqueue(message);\n }\n\n private timeSinceLastFlush() {\n return this.lastFlush === null\n ? Number.MAX_SAFE_INTEGER\n : Temporal.Now.instant().since(this.lastFlush).total(\"milliseconds\");\n }\n\n public warn(message: string) {\n this.options.logger.warn(message);\n this.enqueue(message);\n }\n}\n\nexport default WorkniceIntegrationLogger;\n"],"mappings":"AAAA,OAAO,SAAS;AAChB,SAAS,gBAAgB;AACzB,SAAS,MAAM,YAAY;AAE3B,OAAO,mBAAmB;AAmD1B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,SAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,iBAA0C;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1C,gBAAoC;AAAA;AAAA;AAAA;AAAA,EAKpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,YAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrC,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOb,OAA2D,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ACzB;AAAA,IACF;AAGA,SAAK,aAAa;AAElB,UAAM,KAAK;AAGX,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEO,OAAO,SAAkB;AAC9B,QAAI,YAAY,OAAW,MAAK,KAAK,OAAO;AAC5C,QAAI,KAAK,QAAQ,OAAO,MAAO,MAAK,QAAQ,OAAO,MAAM;AACzD,SAAK,iBAAiB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,KAAK,SAAiB;AAC3B,SAAK,QAAQ,OAAO,KAAK,OAAO;AAChC,SAAK,QAAQ,OAAO;AAAA,EACtB;AAAA,EAEQ,qBAAqB;AAC3B,WAAO,KAAK,cAAc,OACtB,OAAO,mBACP,SAAS,IAAI,QAAQ,EAAE,MAAM,KAAK,SAAS,EAAE,MAAM,cAAc;AAAA,EACvE;AAAA,EAEO,KAAK,SAAiB;AAC3B,SAAK,QAAQ,OAAO,KAAK,OAAO;AAChC,SAAK,QAAQ,OAAO;AAAA,EACtB;AACF;AAEA,IAAO,oCAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/api/WorkniceIntegrationLogger.ts"],"sourcesContent":["import gql from \"dedent\";\nimport { Temporal } from \"temporal-polyfill\";\nimport { v4 as uuid } from \"uuid\";\n\nimport errorToString from \"../utils/errorToString.js\";\nimport type { WorkniceClient } from \"./_types.js\";\n\nexport type Logger = Pick<Console, \"debug\" | \"error\" | \"info\" | \"warn\"> &\n Partial<Pick<Console, \"group\" | \"groupEnd\">>;\n\nexport type WorkniceIntegrationLoggerOptions = {\n /**\n * The type of log to use for debug messages. If set to \"debug\", debug\n * messages will be logged using the logger.debug() method, but if set to\n * \"info\", debug messages will be logged using the logger.info() method.\n *\n * Irrespective of this option, debug messages are only logged to the\n * configured logger and are never sent to the Worknice integration logs.\n *\n * Defaults to \"debug\".\n */\n debugLogType: \"debug\" | \"info\";\n\n /**\n * The delay between flushes in milliseconds. Defaults to 1000 (1 second).\n */\n delayBetweenFlushes: number;\n\n /**\n * A Console-like object with which messages will be logger.\n */\n logger: Logger;\n\n /**\n * The correlation ID to include in all log messages.\n */\n correlationId?: string;\n};\n\n/**\n * A logger that can log messages to both a Console-like object and to a\n * Worknice integration's logs which can be viewed by a Worknice user.\n *\n * By default, messages are only logged to the configured logger, but when a\n * Worknice integration is connected using the connect() method, the messages\n * will also be sent to the Worknice integration logs.\n *\n * @example\n * ```js\n * const logger = new WorkniceIntegrationLogger();\n * logger.info(\"Hello, World!\");\n * logger.debug(\"This message will only be logged to the console.\");\n * logger.error(Error(\"This is an error message.\")); // full stack traces are logged to the console, but only the error message is sent to Worknice\n * logger.connect(workniceClient, integrationId); // connect the logger to a Worknice integration (can be done at any time, messages are buffered until the logger is connected)\n * logger.indent(\"Hello again!\"); // subsequent messages will be indented\n * logger.info(\"This message is indented.\"); // indented\n * logger.dedent(\"Goodbye!\"); // indented, subsequent messages will not be indented\n * await logger.flush(); // sends any unsent messages to Worknice (should be called at the end of the script to ensure all messages are sent)\n * ```\n */\nclass WorkniceIntegrationLogger {\n /**\n * The Worknice client used to send the logs to the server. If null, the logs\n * will be buffered until the logger is initialized.\n */\n private client: WorkniceClient | null = null;\n\n /**\n * A promise used to ensure that only one request is in progress at a time. If\n * a flush is called while a request is in progress, the flush will wait for\n * the request to finish before starting a new one.\n */\n private currentRequest: Promise<unknown> | null = null;\n\n /**\n * The integration ID the logs will be associated with. If undefined, the\n * logs will be buffered until the logger has been initialized.\n */\n private integrationId: string | undefined = undefined;\n\n /**\n * The ID for the integration log to which the logs will be appended.\n * This is set to the same value as correlationId to enable easy tracing\n * between integration logs visible to users and platform logs in Axiom.\n */\n public readonly integrationLogId: string;\n\n /**\n * Determines when the logger should flush the logs. Calling info(), error(),\n * warn(), indent() or dedent() will automatically flush the logs if the last\n * flush was more than 1 second ago.\n */\n private lastFlush: Temporal.Instant | null = null;\n\n /**\n * A flag is used to determine whether a new log should be created when the\n * logger is flushed. The first time the logger is flushed, a new log will be\n * created. Subsequent flushes will append to the existing log.\n */\n private logCreated = false;\n\n /**\n * Backlog of log messages that have not yet been sent to Worknice. The logs\n * will be sent to the server when the logger is flushed and the backlog will\n * be cleared.\n */\n private logs: Array<{ time: Temporal.Instant; message: string }> = [];\n\n /**\n * Determines the current indentation level of the log messages. The indent()\n * and dedent() functions can be used to increase or decrease the indentation\n * level.\n */\n private messageIndent = 0;\n\n private options: WorkniceIntegrationLoggerOptions;\n\n private timeout: NodeJS.Timeout | null = null;\n\n /**\n * @param options.debugLogType The type of console logging to use for debug messages. Defaults to \"debug\".\n * @param options.delayBetweenFlushes The delay between flushes in milliseconds. Defaults to 1000 (1 second).\n * @param options.logger A Console-like object with which messages can be logged. Defaults to the global console object.\n * @param options.correlationId The correlation ID to include in all log messages.\n * @example\n * ```js\n * const logger = new WorkniceIntegrationLogger({ logger: console, correlationId: \"abc123\" });\n * ```\n */\n constructor(options?: Partial<WorkniceIntegrationLoggerOptions>) {\n const correlationId = options?.correlationId?.trim() || uuid();\n this.integrationLogId = correlationId;\n this.options = {\n debugLogType: options?.debugLogType ?? \"debug\",\n delayBetweenFlushes: options?.delayBetweenFlushes ?? 1000,\n logger: options?.logger ?? console,\n correlationId,\n };\n }\n\n /**\n * Gets the correlation ID for this logger session.\n * This will always return a value as correlationId is set during initialization.\n */\n get correlationId(): string {\n return this.options.correlationId!;\n }\n\n /**\n * Connects the logger to a Worknice integration. If there are previously\n * logged messages that need to be flushed, a new integration log will be\n * instantly created and the messages flushed to it. Otherwise, an integration\n * log will be created if/when the first message is logged.\n */\n public connect(client: WorkniceClient, integrationId: string) {\n this.client = client;\n this.integrationId = integrationId;\n this.flush();\n }\n\n /**\n * Logs a debug message. Debug messages are only logged to the configured logger\n * and are never sent to the Worknice integration logs.\n */\n public debug(message: string) {\n const meta = { correlationId: this.options.correlationId };\n if (this.options.debugLogType === \"debug\") {\n this.options.logger.debug(message, meta);\n } else this.options.logger.info(message, meta);\n }\n\n public dedent(message?: string) {\n if (message !== undefined) this.info(message);\n if (this.options.logger.groupEnd) this.options.logger.groupEnd();\n this.messageIndent = Math.max(0, this.messageIndent - 1);\n }\n\n private enqueue(message: string) {\n this.logs.push({\n time: Temporal.Now.instant(),\n message: message\n .split(\"\\n\")\n .map((line) => `${\" \".repeat(this.messageIndent * 2)}${line}`)\n .join(\"\\n\"),\n });\n\n // If the last flush was more than the delay between flushes, flush the logs\n // immediately. Otherwise, schedule a new flush unless one is already\n // scheduled.\n if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {\n this.flush();\n } else if (this.timeout === null) {\n this.timeout = setTimeout(() => {\n if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {\n this.flush();\n }\n }, this.options.delayBetweenFlushes - this.timeSinceLastFlush());\n }\n }\n\n /**\n * Logs an error of any type. The error will be logged to the configured logger\n * with full stack traces and a chain of error causes. A simplified error\n * message will be sent to the Worknice integration logs (if connected) and\n * returned for displaying to the user. If the error is not an instance of\n * Error, it will be coerced into a string before being logged.\n */\n public error(error: unknown) {\n const verboseMessage = errorToString(error, {\n format: \"chain\",\n stack: true,\n });\n\n const simpleMessage = errorToString(error, {\n format: \"simple\",\n stack: false,\n });\n\n const meta = { correlationId: this.options.correlationId };\n this.options.logger.error(verboseMessage, meta);\n this.enqueue(simpleMessage);\n\n return simpleMessage;\n }\n\n /**\n * Flushes the log buffer to the server. The info() function will\n * automatically flush the logs if the last flush was more than 1 second\n * ago, but the flush() function should be called manually at the end of the\n * script to ensure that all logs are sent to the server.\n */\n public async flush() {\n // Clear any scheduled flushes.\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n // Update the last flush time to the current time so that any calls to\n // enqueue will not unnecessarily try to flush the logs again.\n this.lastFlush = Temporal.Now.instant();\n\n // If there's already a request in progress, wait for it to finish before\n // starting a new one.\n if (this.currentRequest) await this.currentRequest;\n\n // If there are no pending logs or the logger hasn't been initialized,\n // don't do anything (any logs will remain in the buffer until the next\n // flush).\n if (this.logs.length === 0 || this.client === null || this.integrationId === null) return;\n\n const entries = this.logs.splice(0).map(({ time, message }) => ({\n time: time.toString({ timeZone: \"Australia/Sydney\", smallestUnit: \"second\" }),\n message,\n }));\n\n this.currentRequest = this.client.fetchFromApi(\n gql`\n mutation AppendIntegrationLog(\n $createNewLog: Boolean!\n $entries: [IntegrationLogInput!]!\n $integrationId: ID!\n $integrationLogId: ID!\n ) {\n createIntegrationLog(integrationId: $integrationId, integrationLogId: $integrationLogId)\n @include(if: $createNewLog) {\n id\n }\n appendIntegrationLog(integrationLogId: $integrationLogId, entries: $entries) {\n id\n }\n }\n `,\n {\n // Only create a new log the first time the logger is flushed.\n createNewLog: !this.logCreated,\n entries,\n integrationId: this.integrationId,\n integrationLogId: this.integrationLogId,\n },\n );\n\n // Only create a new log the first time the logger is flushed.\n this.logCreated = true;\n\n await this.currentRequest;\n\n // Clear the request promise so that the next flush can start a new request.\n this.currentRequest = null;\n }\n\n public indent(message?: string) {\n if (message !== undefined) this.info(message);\n if (this.options.logger.group) this.options.logger.group();\n this.messageIndent += 1;\n }\n\n /**\n * Logs an informational message. The message will be logged to the configured\n * logger and flushed to the Worknice integration logs if/when connected.\n */\n public info(message: string) {\n const meta = { correlationId: this.options.correlationId };\n this.options.logger.info(message, meta);\n this.enqueue(message);\n }\n\n private timeSinceLastFlush() {\n return this.lastFlush === null\n ? Number.MAX_SAFE_INTEGER\n : Temporal.Now.instant().since(this.lastFlush).total(\"milliseconds\");\n }\n\n public warn(message: string) {\n const meta = { correlationId: this.options.correlationId };\n this.options.logger.warn(message, meta);\n this.enqueue(message);\n }\n}\n\nexport default WorkniceIntegrationLogger;\n"],"mappings":"AAAA,OAAO,SAAS;AAChB,SAAS,gBAAgB;AACzB,SAAS,MAAM,YAAY;AAE3B,OAAO,mBAAmB;AAwD1B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,SAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,iBAA0C;AAAA;AAAA;AAAA;AAAA;AAAA,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oCAAQ;","names":[]}
|
package/dist/api/_generated.d.ts
CHANGED
|
@@ -2916,6 +2916,8 @@ type MutationCreateTagsArgs = {
|
|
|
2916
2916
|
type MutationCreateTaskArgs = {
|
|
2917
2917
|
id?: InputMaybe<Scalars['ID']['input']>;
|
|
2918
2918
|
ownerId: Scalars['ID']['input'];
|
|
2919
|
+
subjectId?: InputMaybe<Scalars['ID']['input']>;
|
|
2920
|
+
submissionDueAt?: InputMaybe<Scalars['Date']['input']>;
|
|
2919
2921
|
templateId: Scalars['ID']['input'];
|
|
2920
2922
|
templateParameters?: InputMaybe<Array<TemplateParameterInput>>;
|
|
2921
2923
|
};
|