@worknice/js-sdk 0.0.7 → 0.0.8-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/package.json +5 -3
  2. package/dist/_types-Cobjq3B-.d.ts +0 -761
  3. package/dist/api/ApiError.d.ts +0 -13
  4. package/dist/api/ApiError.js +0 -29
  5. package/dist/api/ApiError.js.map +0 -1
  6. package/dist/api/WorkniceIntegrationLogger.d.ts +0 -125
  7. package/dist/api/WorkniceIntegrationLogger.js +0 -203
  8. package/dist/api/WorkniceIntegrationLogger.js.map +0 -1
  9. package/dist/api/_generated.d.ts +0 -5711
  10. package/dist/api/_generated.js +0 -391
  11. package/dist/api/_generated.js.map +0 -1
  12. package/dist/api/_types.d.ts +0 -2
  13. package/dist/api/_types.js +0 -2
  14. package/dist/api/_types.js.map +0 -1
  15. package/dist/api/assertNotNull.d.ts +0 -5
  16. package/dist/api/assertNotNull.js +0 -14
  17. package/dist/api/assertNotNull.js.map +0 -1
  18. package/dist/api/createApiOperation.d.ts +0 -11
  19. package/dist/api/createApiOperation.js +0 -6
  20. package/dist/api/createApiOperation.js.map +0 -1
  21. package/dist/api/createWorkniceClient.d.ts +0 -2
  22. package/dist/api/createWorkniceClient.js +0 -125
  23. package/dist/api/createWorkniceClient.js.map +0 -1
  24. package/dist/api/operations/activateIntegration.d.ts +0 -22
  25. package/dist/api/operations/activateIntegration.js +0 -29
  26. package/dist/api/operations/activateIntegration.js.map +0 -1
  27. package/dist/api/operations/authorizeIntegration.d.ts +0 -20
  28. package/dist/api/operations/authorizeIntegration.js +0 -23
  29. package/dist/api/operations/authorizeIntegration.js.map +0 -1
  30. package/dist/api/operations/completeSync.d.ts +0 -20
  31. package/dist/api/operations/completeSync.js +0 -23
  32. package/dist/api/operations/completeSync.js.map +0 -1
  33. package/dist/api/operations/createApiToken.d.ts +0 -14
  34. package/dist/api/operations/createApiToken.js +0 -31
  35. package/dist/api/operations/createApiToken.js.map +0 -1
  36. package/dist/api/operations/createDataImport.d.ts +0 -12
  37. package/dist/api/operations/createDataImport.js +0 -25
  38. package/dist/api/operations/createDataImport.js.map +0 -1
  39. package/dist/api/operations/createPersonConnection.d.ts +0 -139
  40. package/dist/api/operations/createPersonConnection.js +0 -66
  41. package/dist/api/operations/createPersonConnection.js.map +0 -1
  42. package/dist/api/operations/createPersonDataImportLine.d.ts +0 -26
  43. package/dist/api/operations/createPersonDataImportLine.js +0 -57
  44. package/dist/api/operations/createPersonDataImportLine.js.map +0 -1
  45. package/dist/api/operations/deleteApiToken.d.ts +0 -10
  46. package/dist/api/operations/deleteApiToken.js +0 -21
  47. package/dist/api/operations/deleteApiToken.js.map +0 -1
  48. package/dist/api/operations/deletePersonConnection.d.ts +0 -10
  49. package/dist/api/operations/deletePersonConnection.js +0 -21
  50. package/dist/api/operations/deletePersonConnection.js.map +0 -1
  51. package/dist/api/operations/getApiTokens.d.ts +0 -14
  52. package/dist/api/operations/getApiTokens.js +0 -39
  53. package/dist/api/operations/getApiTokens.js.map +0 -1
  54. package/dist/api/operations/getIntegration.d.ts +0 -65
  55. package/dist/api/operations/getIntegration.js +0 -32
  56. package/dist/api/operations/getIntegration.js.map +0 -1
  57. package/dist/api/operations/getMyApps.d.ts +0 -37
  58. package/dist/api/operations/getMyApps.js +0 -62
  59. package/dist/api/operations/getMyApps.js.map +0 -1
  60. package/dist/api/operations/getPeople.d.ts +0 -66
  61. package/dist/api/operations/getPeople.js +0 -80
  62. package/dist/api/operations/getPeople.js.map +0 -1
  63. package/dist/api/operations/getPersonConnections.d.ts +0 -114
  64. package/dist/api/operations/getPersonConnections.js +0 -44
  65. package/dist/api/operations/getPersonConnections.js.map +0 -1
  66. package/dist/api/operations/initializeIntegration.d.ts +0 -20
  67. package/dist/api/operations/initializeIntegration.js +0 -23
  68. package/dist/api/operations/initializeIntegration.js.map +0 -1
  69. package/dist/api/operations/updatePerson.d.ts +0 -70
  70. package/dist/api/operations/updatePerson.js +0 -90
  71. package/dist/api/operations/updatePerson.js.map +0 -1
  72. package/dist/api/operations/updatePersonConnection.d.ts +0 -139
  73. package/dist/api/operations/updatePersonConnection.js +0 -66
  74. package/dist/api/operations/updatePersonConnection.js.map +0 -1
  75. package/dist/employee-records/EQUALITY_CHECKS.d.ts +0 -10
  76. package/dist/employee-records/EQUALITY_CHECKS.js +0 -116
  77. package/dist/employee-records/EQUALITY_CHECKS.js.map +0 -1
  78. package/dist/employee-records/_types.d.ts +0 -198
  79. package/dist/employee-records/_types.js +0 -1
  80. package/dist/employee-records/_types.js.map +0 -1
  81. package/dist/employee-records/comparePersonDataTransferLines.d.ts +0 -6
  82. package/dist/employee-records/comparePersonDataTransferLines.js +0 -397
  83. package/dist/employee-records/comparePersonDataTransferLines.js.map +0 -1
  84. package/dist/employee-records/index.d.ts +0 -20
  85. package/dist/employee-records/index.js +0 -33
  86. package/dist/employee-records/index.js.map +0 -1
  87. package/dist/employee-records/mergePersonDataTransferLines.d.ts +0 -6
  88. package/dist/employee-records/mergePersonDataTransferLines.js +0 -23
  89. package/dist/employee-records/mergePersonDataTransferLines.js.map +0 -1
  90. package/dist/employee-records/validatePersonDataTransferLine.d.ts +0 -6
  91. package/dist/employee-records/validatePersonDataTransferLine.js +0 -33
  92. package/dist/employee-records/validatePersonDataTransferLine.js.map +0 -1
  93. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.d.ts +0 -6
  94. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.js +0 -241
  95. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.js.map +0 -1
  96. package/dist/employee-records/validatePersonDataTransferLineDateOfBirth.d.ts +0 -6
  97. package/dist/employee-records/validatePersonDataTransferLineDateOfBirth.js +0 -17
  98. package/dist/employee-records/validatePersonDataTransferLineDateOfBirth.js.map +0 -1
  99. package/dist/employee-records/validatePersonDataTransferLineEmergencyContacts.d.ts +0 -6
  100. package/dist/employee-records/validatePersonDataTransferLineEmergencyContacts.js +0 -6
  101. package/dist/employee-records/validatePersonDataTransferLineEmergencyContacts.js.map +0 -1
  102. package/dist/employee-records/validatePersonDataTransferLineFullName.d.ts +0 -6
  103. package/dist/employee-records/validatePersonDataTransferLineFullName.js +0 -20
  104. package/dist/employee-records/validatePersonDataTransferLineFullName.js.map +0 -1
  105. package/dist/employee-records/validatePersonDataTransferLineGender.d.ts +0 -6
  106. package/dist/employee-records/validatePersonDataTransferLineGender.js +0 -13
  107. package/dist/employee-records/validatePersonDataTransferLineGender.js.map +0 -1
  108. package/dist/employee-records/validatePersonDataTransferLinePersonalEmail.d.ts +0 -6
  109. package/dist/employee-records/validatePersonDataTransferLinePersonalEmail.js +0 -15
  110. package/dist/employee-records/validatePersonDataTransferLinePersonalEmail.js.map +0 -1
  111. package/dist/employee-records/validatePersonDataTransferLinePersonalPhone.d.ts +0 -6
  112. package/dist/employee-records/validatePersonDataTransferLinePersonalPhone.js +0 -15
  113. package/dist/employee-records/validatePersonDataTransferLinePersonalPhone.js.map +0 -1
  114. package/dist/employee-records/validatePersonDataTransferLinePostalAddress.d.ts +0 -6
  115. package/dist/employee-records/validatePersonDataTransferLinePostalAddress.js +0 -39
  116. package/dist/employee-records/validatePersonDataTransferLinePostalAddress.js.map +0 -1
  117. package/dist/employee-records/validatePersonDataTransferLineProfile.d.ts +0 -6
  118. package/dist/employee-records/validatePersonDataTransferLineProfile.js +0 -17
  119. package/dist/employee-records/validatePersonDataTransferLineProfile.js.map +0 -1
  120. package/dist/employee-records/validatePersonDataTransferLineResidentialAddress.d.ts +0 -6
  121. package/dist/employee-records/validatePersonDataTransferLineResidentialAddress.js +0 -39
  122. package/dist/employee-records/validatePersonDataTransferLineResidentialAddress.js.map +0 -1
  123. package/dist/employee-records/validatePersonDataTransferLineSuperFunds.d.ts +0 -6
  124. package/dist/employee-records/validatePersonDataTransferLineSuperFunds.js +0 -46
  125. package/dist/employee-records/validatePersonDataTransferLineSuperFunds.js.map +0 -1
  126. package/dist/employee-records/validatePersonDataTransferLineTaxDetails.d.ts +0 -6
  127. package/dist/employee-records/validatePersonDataTransferLineTaxDetails.js +0 -46
  128. package/dist/employee-records/validatePersonDataTransferLineTaxDetails.js.map +0 -1
  129. package/dist/employee-records/validatePersonDataTransferLineTenure.d.ts +0 -6
  130. package/dist/employee-records/validatePersonDataTransferLineTenure.js +0 -20
  131. package/dist/employee-records/validatePersonDataTransferLineTenure.js.map +0 -1
  132. package/dist/helpers/_types.d.ts +0 -22
  133. package/dist/helpers/_types.js +0 -1
  134. package/dist/helpers/_types.js.map +0 -1
  135. package/dist/helpers/handleApproveLeaveRequestWebhook.d.ts +0 -15
  136. package/dist/helpers/handleApproveLeaveRequestWebhook.js +0 -21
  137. package/dist/helpers/handleApproveLeaveRequestWebhook.js.map +0 -1
  138. package/dist/helpers/handleCancelLeaveRequestWebhook.d.ts +0 -15
  139. package/dist/helpers/handleCancelLeaveRequestWebhook.js +0 -21
  140. package/dist/helpers/handleCancelLeaveRequestWebhook.js.map +0 -1
  141. package/dist/helpers/handleCreateIntegrationWebhook.d.ts +0 -14
  142. package/dist/helpers/handleCreateIntegrationWebhook.js +0 -42
  143. package/dist/helpers/handleCreateIntegrationWebhook.js.map +0 -1
  144. package/dist/helpers/handleCreateLeaveRequestWebhook.d.ts +0 -15
  145. package/dist/helpers/handleCreateLeaveRequestWebhook.js +0 -21
  146. package/dist/helpers/handleCreateLeaveRequestWebhook.js.map +0 -1
  147. package/dist/helpers/handleDenyLeaveRequestWebhook.d.ts +0 -15
  148. package/dist/helpers/handleDenyLeaveRequestWebhook.js +0 -21
  149. package/dist/helpers/handleDenyLeaveRequestWebhook.js.map +0 -1
  150. package/dist/helpers/handleGetAuthorizationUrlWebhook.d.ts +0 -12
  151. package/dist/helpers/handleGetAuthorizationUrlWebhook.js +0 -27
  152. package/dist/helpers/handleGetAuthorizationUrlWebhook.js.map +0 -1
  153. package/dist/helpers/handleGetLeaveBalancesWebhook.d.ts +0 -13
  154. package/dist/helpers/handleGetLeaveBalancesWebhook.js +0 -27
  155. package/dist/helpers/handleGetLeaveBalancesWebhook.js.map +0 -1
  156. package/dist/helpers/handleGetLeaveCategoriesWebhook.d.ts +0 -15
  157. package/dist/helpers/handleGetLeaveCategoriesWebhook.js +0 -27
  158. package/dist/helpers/handleGetLeaveCategoriesWebhook.js.map +0 -1
  159. package/dist/helpers/handleGetLeaveRequestHoursWebhook.d.ts +0 -13
  160. package/dist/helpers/handleGetLeaveRequestHoursWebhook.js +0 -27
  161. package/dist/helpers/handleGetLeaveRequestHoursWebhook.js.map +0 -1
  162. package/dist/helpers/handleProcessLeaveRequestWebhook.d.ts +0 -15
  163. package/dist/helpers/handleProcessLeaveRequestWebhook.js +0 -21
  164. package/dist/helpers/handleProcessLeaveRequestWebhook.js.map +0 -1
  165. package/dist/helpers/handleRequest.d.ts +0 -12
  166. package/dist/helpers/handleRequest.js +0 -58
  167. package/dist/helpers/handleRequest.js.map +0 -1
  168. package/dist/helpers/handleRequestWithWorknice.d.ts +0 -23
  169. package/dist/helpers/handleRequestWithWorknice.js +0 -44
  170. package/dist/helpers/handleRequestWithWorknice.js.map +0 -1
  171. package/dist/helpers/handleTriggerIntegrationSyncWebhook.d.ts +0 -76
  172. package/dist/helpers/handleTriggerIntegrationSyncWebhook.js +0 -750
  173. package/dist/helpers/handleTriggerIntegrationSyncWebhook.js.map +0 -1
  174. package/dist/helpers/index.d.ts +0 -19
  175. package/dist/helpers/index.js +0 -29
  176. package/dist/helpers/index.js.map +0 -1
  177. package/dist/index.d.ts +0 -20
  178. package/dist/index.js +0 -10
  179. package/dist/index.js.map +0 -1
  180. package/dist/utils/disambiguatePersonConnections.d.ts +0 -25
  181. package/dist/utils/disambiguatePersonConnections.js +0 -18
  182. package/dist/utils/disambiguatePersonConnections.js.map +0 -1
  183. package/dist/utils/errorToString.d.ts +0 -22
  184. package/dist/utils/errorToString.js +0 -30
  185. package/dist/utils/errorToString.js.map +0 -1
  186. package/dist/utils/isNotNullable.d.ts +0 -10
  187. package/dist/utils/isNotNullable.js +0 -6
  188. package/dist/utils/isNotNullable.js.map +0 -1
  189. package/dist/utils/isSamePlainDate.d.ts +0 -3
  190. package/dist/utils/isSamePlainDate.js +0 -5
  191. package/dist/utils/isSamePlainDate.js.map +0 -1
  192. package/dist/utils/isValidPlainDate.d.ts +0 -1
  193. package/dist/utils/isValidPlainDate.js +0 -5
  194. package/dist/utils/isValidPlainDate.js.map +0 -1
  195. package/dist/utils/parsePlainDate.d.ts +0 -1
  196. package/dist/utils/parsePlainDate.js +0 -5
  197. package/dist/utils/parsePlainDate.js.map +0 -1
  198. package/dist/webhooks.d.ts +0 -112
  199. package/dist/webhooks.js +0 -1
  200. package/dist/webhooks.js.map +0 -1
@@ -1,13 +0,0 @@
1
- declare class ApiError extends Error {
2
- readonly code: ApiErrorCode;
3
- constructor(code: ApiErrorCode, options?: ErrorOptions);
4
- }
5
- declare enum ApiErrorCode {
6
- INVALID_QUERY = "INVALID_QUERY",
7
- QUERY_EXECUTION_FAILED = "QUERY_EXECUTION_FAILED",
8
- SESSION_UNASSOCIATED = "SESSION_UNASSOCIATED",
9
- SESSION_UNAUTHENTICATED = "SESSION_UNAUTHENTICATED",
10
- UNEXPECTED_RESPONSE = "UNEXPECTED_RESPONSE"
11
- }
12
-
13
- export { ApiErrorCode, ApiError as default };
@@ -1,29 +0,0 @@
1
- class ApiError extends Error {
2
- code;
3
- constructor(code, options) {
4
- super(ApiErrorCodeMessage[code], options);
5
- this.name = "ApiError";
6
- this.code = code;
7
- }
8
- }
9
- var ApiErrorCode = /* @__PURE__ */ ((ApiErrorCode2) => {
10
- ApiErrorCode2["INVALID_QUERY"] = "INVALID_QUERY";
11
- ApiErrorCode2["QUERY_EXECUTION_FAILED"] = "QUERY_EXECUTION_FAILED";
12
- ApiErrorCode2["SESSION_UNASSOCIATED"] = "SESSION_UNASSOCIATED";
13
- ApiErrorCode2["SESSION_UNAUTHENTICATED"] = "SESSION_UNAUTHENTICATED";
14
- ApiErrorCode2["UNEXPECTED_RESPONSE"] = "UNEXPECTED_RESPONSE";
15
- return ApiErrorCode2;
16
- })(ApiErrorCode || {});
17
- const ApiErrorCodeMessage = {
18
- ["INVALID_QUERY" /* INVALID_QUERY */]: "The Worknice API was unable to execute the query. This could be due to a syntax error or invalid query.",
19
- ["QUERY_EXECUTION_FAILED" /* QUERY_EXECUTION_FAILED */]: "The Worknice API returned an error while executing the query.",
20
- ["SESSION_UNAUTHENTICATED" /* SESSION_UNAUTHENTICATED */]: "API token is missing or invalid.",
21
- ["SESSION_UNASSOCIATED" /* SESSION_UNASSOCIATED */]: "No person, org or account associated with the session. The session is in 'unassociated' state (the user has no active logins).",
22
- ["UNEXPECTED_RESPONSE" /* UNEXPECTED_RESPONSE */]: "The API returned an unexpected response. This could be a configuration problem (wrong URL for the API endpoint) or an outdated/mismatched JS-SDK version."
23
- };
24
- var ApiError_default = ApiError;
25
- export {
26
- ApiErrorCode,
27
- ApiError_default as default
28
- };
29
- //# sourceMappingURL=ApiError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/ApiError.ts"],"sourcesContent":["class ApiError extends Error {\n readonly code: ApiErrorCode;\n constructor(code: ApiErrorCode, options?: ErrorOptions) {\n super(ApiErrorCodeMessage[code], options);\n this.name = \"ApiError\";\n this.code = code;\n }\n}\n\nenum ApiErrorCode {\n INVALID_QUERY = \"INVALID_QUERY\",\n QUERY_EXECUTION_FAILED = \"QUERY_EXECUTION_FAILED\",\n SESSION_UNASSOCIATED = \"SESSION_UNASSOCIATED\",\n SESSION_UNAUTHENTICATED = \"SESSION_UNAUTHENTICATED\",\n UNEXPECTED_RESPONSE = \"UNEXPECTED_RESPONSE\",\n}\n\nconst ApiErrorCodeMessage: Record<ApiErrorCode, string> = {\n [ApiErrorCode.INVALID_QUERY]:\n \"The Worknice API was unable to execute the query. This could be due to a syntax error or invalid query.\",\n [ApiErrorCode.QUERY_EXECUTION_FAILED]:\n \"The Worknice API returned an error while executing the query.\",\n [ApiErrorCode.SESSION_UNAUTHENTICATED]: \"API token is missing or invalid.\",\n [ApiErrorCode.SESSION_UNASSOCIATED]:\n \"No person, org or account associated with the session. The session is in 'unassociated' state (the user has no active logins).\",\n [ApiErrorCode.UNEXPECTED_RESPONSE]:\n \"The API returned an unexpected response. This could be a configuration problem (wrong URL for the API endpoint) or an outdated/mismatched JS-SDK version.\",\n} as const;\n\nexport default ApiError;\nexport { ApiErrorCode };\n"],"mappings":"AAAA,MAAM,iBAAiB,MAAM;AAAA,EAClB;AAAA,EACT,YAAY,MAAoB,SAAwB;AACtD,UAAM,oBAAoB,IAAI,GAAG,OAAO;AACxC,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AACF;AAEA,IAAK,eAAL,kBAAKA,kBAAL;AACE,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,4BAAyB;AACzB,EAAAA,cAAA,0BAAuB;AACvB,EAAAA,cAAA,6BAA0B;AAC1B,EAAAA,cAAA,yBAAsB;AALnB,SAAAA;AAAA,GAAA;AAQL,MAAM,sBAAoD;AAAA,EACxD,CAAC,mCAA0B,GACzB;AAAA,EACF,CAAC,qDAAmC,GAClC;AAAA,EACF,CAAC,uDAAoC,GAAG;AAAA,EACxC,CAAC,iDAAiC,GAChC;AAAA,EACF,CAAC,+CAAgC,GAC/B;AACJ;AAEA,IAAO,mBAAQ;","names":["ApiErrorCode"]}
@@ -1,125 +0,0 @@
1
- import { W as WorkniceClient } from '../_types-Cobjq3B-.js';
2
- import './_generated.js';
3
-
4
- type Logger = Pick<Console, "debug" | "error" | "info" | "warn"> & Partial<Pick<Console, "group" | "groupEnd">>;
5
- type WorkniceIntegrationLoggerOptions = {
6
- /**
7
- * The type of log to use for debug messages. If set to "debug", debug
8
- * messages will be logged using the logger.debug() method, but if set to
9
- * "info", debug messages will be logged using the logger.info() method.
10
- *
11
- * Irrespective of this option, debug messages are only logged to the
12
- * configured logger and are never sent to the Worknice integration logs.
13
- *
14
- * Defaults to "debug".
15
- */
16
- debugLogType: "debug" | "info";
17
- /**
18
- * The delay between flushes in milliseconds. Defaults to 1000 (1 second).
19
- */
20
- delayBetweenFlushes: number;
21
- /**
22
- * A Console-like object with which messages will be logger.
23
- */
24
- logger: Logger;
25
- };
26
- declare class WorkniceIntegrationLogger {
27
- /**
28
- * The Worknice client used to send the logs to the server. If null, the logs
29
- * will be buffered until the logger is initialized.
30
- */
31
- private client;
32
- /**
33
- * A promise used to ensure that only one request is in progress at a time. If
34
- * a flush is called while a request is in progress, the flush will wait for
35
- * the request to finish before starting a new one.
36
- */
37
- private currentRequest;
38
- /**
39
- * The integration ID the logs will be associated with. If undefined, the
40
- * logs will be buffered until the logger has been initialized.
41
- */
42
- private integrationId;
43
- /**
44
- * The random ID for the integration log to which the logs will be appended.
45
- */
46
- private integrationLogId;
47
- /**
48
- * Determines when the logger should flush the logs. Calling info(), error(),
49
- * warn(), indent() or dedent() will automatically flush the logs if the last
50
- * flush was more than 1 second ago.
51
- */
52
- private lastFlush;
53
- /**
54
- * A flag is used to determine whether a new log should be created when the
55
- * logger is flushed. The first time the logger is flushed, a new log will be
56
- * created. Subsequent flushes will append to the existing log.
57
- */
58
- private logCreated;
59
- /**
60
- * Backlog of log messages that have not yet been sent to Worknice. The logs
61
- * will be sent to the server when the logger is flushed and the backlog will
62
- * be cleared.
63
- */
64
- private logs;
65
- /**
66
- * Determines the current indentation level of the log messages. The indent()
67
- * and dedent() functions can be used to increase or decrease the indentation
68
- * level.
69
- */
70
- private messageIndent;
71
- private options;
72
- private timeout;
73
- /**
74
- * A logger can log messages to both a Console-like object and to a Worknice
75
- * integration's logs which can be view by a Worknice user. By default,
76
- * messages are only logged to the configured logger, but when a Worknice
77
- * integration is connected using the connect() method, the messages will also
78
- * be sent to the Worknice integration logs.
79
- * @param logger A Console-like object with which messages can be logged.
80
- * @example
81
- * ```js
82
- * const logger = new WorkniceIntegrationLogger({ logger: console });
83
- * ```
84
- */
85
- constructor(options?: Partial<WorkniceIntegrationLoggerOptions>);
86
- /**
87
- * Connects the logger to a Worknice integration. If there are previously
88
- * logged messages that need to be flushed, a new integration log will be
89
- * instantly created and the messages flushed to it. Otherwise, an integration
90
- * log will be created if/when the first message is logged.
91
- */
92
- connect(client: WorkniceClient, integrationId: string): void;
93
- /**
94
- * Logs a debug message. Debug messages are only logged to the configured logger
95
- * and are never sent to the Worknice integration logs.
96
- */
97
- debug(message: string): void;
98
- dedent(message?: string): void;
99
- private enqueue;
100
- /**
101
- * Logs an error of any type. The error will be logged to the configured logger
102
- * with full stack traces and a chain of error causes. A simplified error
103
- * message will sent to the Worknice integration logs (if connected) and
104
- * returned for displaying to the user. If the error is not an instance of
105
- * Error, it will be coerced into a string before being logged.
106
- */
107
- error(error: unknown): string;
108
- /**
109
- * Flushes the log buffer to the server. The info() function will
110
- * automatically flush the logs if the last flush was more than 1 second
111
- * ago, but the flush() function should be called manually at the end of the
112
- * script to ensure that all logs are sent to the server.
113
- */
114
- flush(): Promise<void>;
115
- indent(message?: string): void;
116
- /**
117
- * Logs an informational message. The message will be logged to the configured
118
- * logger and flushed to the Worknice integration logs if/when connected.
119
- */
120
- info(message: string): void;
121
- private timeSinceLastFlush;
122
- warn(message: string): void;
123
- }
124
-
125
- export { type Logger, type WorkniceIntegrationLoggerOptions, WorkniceIntegrationLogger as default };
@@ -1,203 +0,0 @@
1
- import gql from "dedent";
2
- import { Temporal } from "temporal-polyfill";
3
- import { v4 as uuid } from "uuid";
4
- import errorToString from "../utils/errorToString.js";
5
- class WorkniceIntegrationLogger {
6
- /**
7
- * The Worknice client used to send the logs to the server. If null, the logs
8
- * will be buffered until the logger is initialized.
9
- */
10
- client = null;
11
- /**
12
- * A promise used to ensure that only one request is in progress at a time. If
13
- * a flush is called while a request is in progress, the flush will wait for
14
- * the request to finish before starting a new one.
15
- */
16
- currentRequest = null;
17
- /**
18
- * The integration ID the logs will be associated with. If undefined, the
19
- * logs will be buffered until the logger has been initialized.
20
- */
21
- integrationId = void 0;
22
- /**
23
- * The random ID for the integration log to which the logs will be appended.
24
- */
25
- integrationLogId;
26
- /**
27
- * Determines when the logger should flush the logs. Calling info(), error(),
28
- * warn(), indent() or dedent() will automatically flush the logs if the last
29
- * flush was more than 1 second ago.
30
- */
31
- lastFlush = null;
32
- /**
33
- * A flag is used to determine whether a new log should be created when the
34
- * logger is flushed. The first time the logger is flushed, a new log will be
35
- * created. Subsequent flushes will append to the existing log.
36
- */
37
- logCreated = false;
38
- /**
39
- * Backlog of log messages that have not yet been sent to Worknice. The logs
40
- * will be sent to the server when the logger is flushed and the backlog will
41
- * be cleared.
42
- */
43
- logs = [];
44
- /**
45
- * Determines the current indentation level of the log messages. The indent()
46
- * and dedent() functions can be used to increase or decrease the indentation
47
- * level.
48
- */
49
- messageIndent = 0;
50
- options;
51
- timeout = null;
52
- /**
53
- * A logger can log messages to both a Console-like object and to a Worknice
54
- * integration's logs which can be view by a Worknice user. By default,
55
- * messages are only logged to the configured logger, but when a Worknice
56
- * integration is connected using the connect() method, the messages will also
57
- * be sent to the Worknice integration logs.
58
- * @param logger A Console-like object with which messages can be logged.
59
- * @example
60
- * ```js
61
- * const logger = new WorkniceIntegrationLogger({ logger: console });
62
- * ```
63
- */
64
- constructor(options) {
65
- this.integrationLogId = uuid();
66
- this.options = {
67
- debugLogType: options?.debugLogType ?? "debug",
68
- delayBetweenFlushes: options?.delayBetweenFlushes ?? 1e3,
69
- logger: options?.logger ?? console
70
- };
71
- }
72
- /**
73
- * Connects the logger to a Worknice integration. If there are previously
74
- * logged messages that need to be flushed, a new integration log will be
75
- * instantly created and the messages flushed to it. Otherwise, an integration
76
- * log will be created if/when the first message is logged.
77
- */
78
- connect(client, integrationId) {
79
- this.client = client;
80
- this.integrationId = integrationId;
81
- this.flush();
82
- }
83
- /**
84
- * Logs a debug message. Debug messages are only logged to the configured logger
85
- * and are never sent to the Worknice integration logs.
86
- */
87
- debug(message) {
88
- if (this.options.debugLogType === "debug") this.options.logger.debug(message);
89
- else this.options.logger.info(message);
90
- }
91
- dedent(message) {
92
- if (message !== void 0) this.info(message);
93
- if (this.options.logger.groupEnd) this.options.logger.groupEnd();
94
- this.messageIndent = Math.max(0, this.messageIndent - 1);
95
- }
96
- enqueue(message) {
97
- this.logs.push({
98
- time: Temporal.Now.instant(),
99
- message: message.split("\n").map((line) => `${" ".repeat(this.messageIndent * 2)}${line}`).join("\n")
100
- });
101
- if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {
102
- this.flush();
103
- } else if (this.timeout === null) {
104
- this.timeout = setTimeout(() => {
105
- if (this.timeSinceLastFlush() >= this.options.delayBetweenFlushes) {
106
- this.flush();
107
- }
108
- }, this.options.delayBetweenFlushes - this.timeSinceLastFlush());
109
- }
110
- }
111
- /**
112
- * Logs an error of any type. The error will be logged to the configured logger
113
- * with full stack traces and a chain of error causes. A simplified error
114
- * message will sent to the Worknice integration logs (if connected) and
115
- * returned for displaying to the user. If the error is not an instance of
116
- * Error, it will be coerced into a string before being logged.
117
- */
118
- error(error) {
119
- const verboseMessage = errorToString(error, {
120
- format: "chain",
121
- stack: true
122
- });
123
- const simpleMessage = errorToString(error, {
124
- format: "simple",
125
- stack: false
126
- });
127
- this.options.logger.error(verboseMessage);
128
- this.enqueue(simpleMessage);
129
- return simpleMessage;
130
- }
131
- /**
132
- * Flushes the log buffer to the server. The info() function will
133
- * automatically flush the logs if the last flush was more than 1 second
134
- * ago, but the flush() function should be called manually at the end of the
135
- * script to ensure that all logs are sent to the server.
136
- */
137
- async flush() {
138
- if (this.timeout) {
139
- clearTimeout(this.timeout);
140
- this.timeout = null;
141
- }
142
- this.lastFlush = Temporal.Now.instant();
143
- if (this.currentRequest) await this.currentRequest;
144
- if (this.logs.length === 0 || this.client === null || this.integrationId === null) return;
145
- const entries = this.logs.splice(0).map(({ time, message }) => ({
146
- time: time.toString({ timeZone: "Australia/Sydney", smallestUnit: "second" }),
147
- message
148
- }));
149
- this.currentRequest = this.client.fetchFromApi(
150
- gql`
151
- mutation AppendIntegrationLog(
152
- $createNewLog: Boolean!
153
- $entries: [IntegrationLogInput!]!
154
- $integrationId: ID!
155
- $integrationLogId: ID!
156
- ) {
157
- createIntegrationLog(integrationId: $integrationId, integrationLogId: $integrationLogId)
158
- @include(if: $createNewLog) {
159
- id
160
- }
161
- appendIntegrationLog(integrationLogId: $integrationLogId, entries: $entries) {
162
- id
163
- }
164
- }
165
- `,
166
- {
167
- // Only create a new log the first time the logger is flushed.
168
- createNewLog: this.logCreated === false,
169
- entries,
170
- integrationId: this.integrationId,
171
- integrationLogId: this.integrationLogId
172
- }
173
- );
174
- this.logCreated = true;
175
- await this.currentRequest;
176
- this.currentRequest = null;
177
- }
178
- indent(message) {
179
- if (message !== void 0) this.info(message);
180
- if (this.options.logger.group) this.options.logger.group();
181
- this.messageIndent += 1;
182
- }
183
- /**
184
- * Logs an informational message. The message will be logged to the configured
185
- * logger and flushed to the Worknice integration logs if/when connected.
186
- */
187
- info(message) {
188
- this.options.logger.info(message);
189
- this.enqueue(message);
190
- }
191
- timeSinceLastFlush() {
192
- return this.lastFlush === null ? Number.MAX_SAFE_INTEGER : Temporal.Now.instant().since(this.lastFlush).total("milliseconds");
193
- }
194
- warn(message) {
195
- this.options.logger.warn(message);
196
- this.enqueue(message);
197
- }
198
- }
199
- var WorkniceIntegrationLogger_default = WorkniceIntegrationLogger;
200
- export {
201
- WorkniceIntegrationLogger_default as default
202
- };
203
- //# sourceMappingURL=WorkniceIntegrationLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/WorkniceIntegrationLogger.ts"],"sourcesContent":["import gql from \"dedent\";\nimport { Temporal } from \"temporal-polyfill\";\nimport { v4 as uuid } from \"uuid\";\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\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 * A logger can log messages to both a Console-like object and to a Worknice\n * integration's logs which can be view by a Worknice user. By default,\n * messages are only logged to the configured logger, but when a Worknice\n * integration is connected using the connect() method, the messages will also\n * be sent to the Worknice integration logs.\n * @param logger A Console-like object with which messages can be logged.\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;AAC3B,OAAO,mBAAmB;AA8B1B,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,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5D,gBAAgB;AAAA,EAEhB;AAAA,EAEA,UAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAczC,YAAY,SAAqD;AAC/D,SAAK,mBAAmB,KAAK;AAC7B,SAAK,UAAU;AAAA,MACb,cAAc,SAAS,gBAAgB;AAAA,MACvC,qBAAqB,SAAS,uBAAuB;AAAA,MACrD,QAAQ,SAAS,UAAU;AAAA,IAC7B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,QAAQ,QAAwB,eAAuB;AAC5D,SAAK,SAAS;AACd,SAAK,gBAAgB;AACrB,SAAK,MAAM;AAAA,EACb;AAA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