@extrahorizon/javascript-sdk 8.2.0-test

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 (153) hide show
  1. package/CHANGELOG.md +1161 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -0
  4. package/build/index.cjs.js +1 -0
  5. package/build/index.mjs +1 -0
  6. package/build/types/btoa.d.ts +6 -0
  7. package/build/types/client.d.ts +136 -0
  8. package/build/types/constants.d.ts +15 -0
  9. package/build/types/errorHandler.d.ts +2 -0
  10. package/build/types/errors.d.ts +332 -0
  11. package/build/types/http/client.d.ts +2 -0
  12. package/build/types/http/index.d.ts +4 -0
  13. package/build/types/http/interceptors.d.ts +9 -0
  14. package/build/types/http/oAuth1Signature.d.ts +14 -0
  15. package/build/types/http/oauth1.d.ts +3 -0
  16. package/build/types/http/oauth2.d.ts +3 -0
  17. package/build/types/http/proxy.d.ts +3 -0
  18. package/build/types/http/types.d.ts +331 -0
  19. package/build/types/http/utils.d.ts +21 -0
  20. package/build/types/index.d.ts +9 -0
  21. package/build/types/mock.d.ts +43 -0
  22. package/build/types/mockType.d.ts +1511 -0
  23. package/build/types/parseStoredCredentials.d.ts +11 -0
  24. package/build/types/rql/index.d.ts +16 -0
  25. package/build/types/rql/parser.d.ts +1 -0
  26. package/build/types/rql/types.d.ts +168 -0
  27. package/build/types/services/auth/applications/index.d.ts +5 -0
  28. package/build/types/services/auth/applications/types.d.ts +190 -0
  29. package/build/types/services/auth/index.d.ts +3 -0
  30. package/build/types/services/auth/oauth1/index.d.ts +5 -0
  31. package/build/types/services/auth/oauth1/types.d.ts +63 -0
  32. package/build/types/services/auth/oauth2/index.d.ts +5 -0
  33. package/build/types/services/auth/oauth2/types.d.ts +52 -0
  34. package/build/types/services/auth/oidc/index.d.ts +5 -0
  35. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  36. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  37. package/build/types/services/auth/oidc/providers/index.d.ts +5 -0
  38. package/build/types/services/auth/oidc/providers/types.d.ts +144 -0
  39. package/build/types/services/auth/oidc/types.d.ts +40 -0
  40. package/build/types/services/auth/types.d.ts +39 -0
  41. package/build/types/services/auth/users/index.d.ts +5 -0
  42. package/build/types/services/auth/users/types.d.ts +121 -0
  43. package/build/types/services/configurations/general.d.ts +5 -0
  44. package/build/types/services/configurations/groups.d.ts +5 -0
  45. package/build/types/services/configurations/index.d.ts +10 -0
  46. package/build/types/services/configurations/patients.d.ts +5 -0
  47. package/build/types/services/configurations/staff.d.ts +5 -0
  48. package/build/types/services/configurations/types.d.ts +222 -0
  49. package/build/types/services/configurations/users.d.ts +5 -0
  50. package/build/types/services/data/comments.d.ts +5 -0
  51. package/build/types/services/data/documents.d.ts +5 -0
  52. package/build/types/services/data/index.d.ts +13 -0
  53. package/build/types/services/data/indexes.d.ts +5 -0
  54. package/build/types/services/data/infrastructure.d.ts +10 -0
  55. package/build/types/services/data/json-schema.d.ts +121 -0
  56. package/build/types/services/data/properties.d.ts +5 -0
  57. package/build/types/services/data/schemas.d.ts +5 -0
  58. package/build/types/services/data/statuses.d.ts +5 -0
  59. package/build/types/services/data/transitions.d.ts +5 -0
  60. package/build/types/services/data/types.d.ts +899 -0
  61. package/build/types/services/dispatchers/actions/index.d.ts +5 -0
  62. package/build/types/services/dispatchers/actions/types.d.ts +78 -0
  63. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -0
  64. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -0
  65. package/build/types/services/dispatchers/index.d.ts +7 -0
  66. package/build/types/services/dispatchers/types.d.ts +2 -0
  67. package/build/types/services/events/events.d.ts +5 -0
  68. package/build/types/services/events/health.d.ts +9 -0
  69. package/build/types/services/events/index.d.ts +6 -0
  70. package/build/types/services/events/subscriptions.d.ts +5 -0
  71. package/build/types/services/events/types.d.ts +90 -0
  72. package/build/types/services/files/files.d.ts +5 -0
  73. package/build/types/services/files/formHelpers.d.ts +3 -0
  74. package/build/types/services/files/index.d.ts +6 -0
  75. package/build/types/services/files/settings/index.d.ts +5 -0
  76. package/build/types/services/files/settings/types.d.ts +38 -0
  77. package/build/types/services/files/tokens.d.ts +5 -0
  78. package/build/types/services/files/types.d.ts +185 -0
  79. package/build/types/services/helpers.d.ts +7 -0
  80. package/build/types/services/http-client.d.ts +22 -0
  81. package/build/types/services/index.d.ts +15 -0
  82. package/build/types/services/localizations/countries.d.ts +5 -0
  83. package/build/types/services/localizations/health.d.ts +9 -0
  84. package/build/types/services/localizations/index.d.ts +4 -0
  85. package/build/types/services/localizations/languages.d.ts +5 -0
  86. package/build/types/services/localizations/localizations.d.ts +5 -0
  87. package/build/types/services/localizations/types.d.ts +145 -0
  88. package/build/types/services/logs/access/index.d.ts +5 -0
  89. package/build/types/services/logs/access/types.d.ts +41 -0
  90. package/build/types/services/logs/index.d.ts +3 -0
  91. package/build/types/services/logs/types.d.ts +4 -0
  92. package/build/types/services/mails/index.d.ts +3 -0
  93. package/build/types/services/mails/mails.d.ts +5 -0
  94. package/build/types/services/mails/types.d.ts +141 -0
  95. package/build/types/services/notifications/health.d.ts +9 -0
  96. package/build/types/services/notifications/index.d.ts +7 -0
  97. package/build/types/services/notifications/notifications.d.ts +5 -0
  98. package/build/types/services/notifications/settings.d.ts +5 -0
  99. package/build/types/services/notifications/types.d.ts +222 -0
  100. package/build/types/services/payments/appStore.d.ts +5 -0
  101. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/types/services/payments/health.d.ts +9 -0
  103. package/build/types/services/payments/index.d.ts +15 -0
  104. package/build/types/services/payments/orders.d.ts +5 -0
  105. package/build/types/services/payments/playStore.d.ts +5 -0
  106. package/build/types/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/types/services/payments/products.d.ts +5 -0
  109. package/build/types/services/payments/stripe.d.ts +5 -0
  110. package/build/types/services/payments/subscriptions.d.ts +5 -0
  111. package/build/types/services/payments/types.d.ts +1189 -0
  112. package/build/types/services/profiles/groups.d.ts +5 -0
  113. package/build/types/services/profiles/health.d.ts +9 -0
  114. package/build/types/services/profiles/index.d.ts +9 -0
  115. package/build/types/services/profiles/logs.d.ts +5 -0
  116. package/build/types/services/profiles/profiles.d.ts +5 -0
  117. package/build/types/services/profiles/types.d.ts +369 -0
  118. package/build/types/services/tasks/api/index.d.ts +5 -0
  119. package/build/types/services/tasks/api/types.d.ts +146 -0
  120. package/build/types/services/tasks/apiRequests/index.d.ts +5 -0
  121. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -0
  122. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -0
  123. package/build/types/services/tasks/apiRequests/types.d.ts +83 -0
  124. package/build/types/services/tasks/functions/index.d.ts +5 -0
  125. package/build/types/services/tasks/functions/types.d.ts +27 -0
  126. package/build/types/services/tasks/index.d.ts +15 -0
  127. package/build/types/services/tasks/logs/index.d.ts +5 -0
  128. package/build/types/services/tasks/logs/types.d.ts +28 -0
  129. package/build/types/services/tasks/schedules/index.d.ts +5 -0
  130. package/build/types/services/tasks/schedules/types.d.ts +88 -0
  131. package/build/types/services/tasks/tasks.d.ts +5 -0
  132. package/build/types/services/tasks/types.d.ts +107 -0
  133. package/build/types/services/templates/index.d.ts +3 -0
  134. package/build/types/services/templates/templates.d.ts +5 -0
  135. package/build/types/services/templates/types.d.ts +202 -0
  136. package/build/types/services/types.d.ts +77 -0
  137. package/build/types/services/users/activationRequests/index.d.ts +4 -0
  138. package/build/types/services/users/activationRequests/types.d.ts +70 -0
  139. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -0
  140. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -0
  141. package/build/types/services/users/globalRoles.d.ts +5 -0
  142. package/build/types/services/users/groupRoles.d.ts +5 -0
  143. package/build/types/services/users/health.d.ts +9 -0
  144. package/build/types/services/users/index.d.ts +16 -0
  145. package/build/types/services/users/settings/index.d.ts +4 -0
  146. package/build/types/services/users/settings/types.d.ts +47 -0
  147. package/build/types/services/users/types.d.ts +1055 -0
  148. package/build/types/services/users/users.d.ts +5 -0
  149. package/build/types/sha1.d.ts +11 -0
  150. package/build/types/types.d.ts +102 -0
  151. package/build/types/utils.d.ts +4 -0
  152. package/build/types/version.d.ts +1 -0
  153. package/package.json +57 -0
@@ -0,0 +1,4 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import health from './health';
3
+ import { CountriesService, LanguagesService, LocalizationsService } from './types';
4
+ export declare const localizationsService: (httpWithAuth: HttpInstance) => ReturnType<typeof health> & LocalizationsService & CountriesService & LanguagesService;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { LanguagesService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => LanguagesService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { LocalizationsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => LocalizationsService;
5
+ export default _default;
@@ -0,0 +1,145 @@
1
+ import { RQLString } from '../../rql';
2
+ import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../types';
3
+ export declare enum SupportedLanguageCodes {
4
+ EN = "EN",
5
+ NL = "NL",
6
+ DE = "DE",
7
+ FR = "FR",
8
+ DA = "DA",
9
+ ES = "ES",
10
+ IT = "IT"
11
+ }
12
+ declare type SupportedLanguageCodesValues = keyof typeof SupportedLanguageCodes;
13
+ export declare type MappedText = Record<SupportedLanguageCodesValues, string>;
14
+ export interface Localization {
15
+ key: string;
16
+ text: {
17
+ [K in SupportedLanguageCodesValues]?: string;
18
+ };
19
+ creationTimestamp?: Date;
20
+ updateTimestamp?: Date;
21
+ }
22
+ export interface BulkLocalization {
23
+ localizations?: Array<Pick<Localization, 'key' | 'text'>>;
24
+ }
25
+ /**
26
+ * The 'created' field shows how many new localizations were succesfully created. The 'existing' field shows how many localizations with the given keys already existed. Eventually, the 'existing_ids' fields shows exactly which localizations already existed. Old localizations will not be overwritten by new ones.
27
+ */
28
+ export interface BulkCreationResponse {
29
+ created?: number;
30
+ existing?: number;
31
+ existingIds?: string[];
32
+ }
33
+ /**
34
+ * The 'updated' field shows how many localizations were succesfully updated. The 'missing' field shows how many localizations with the given keys couldn't be found. Eventually, the 'missing_ids' fields shows exactly which localizations couldn't be found and are thus not updated.
35
+ */
36
+ export interface BulkUpdateResponse {
37
+ updated?: number;
38
+ missing?: number;
39
+ missingIds?: string[];
40
+ }
41
+ export interface LocalizationRequest {
42
+ localizationCodes: SupportedLanguageCodesValues[];
43
+ localizations: string[];
44
+ }
45
+ export interface CountriesService {
46
+ /**
47
+ * Retrieve a list of all the defined countries
48
+ *
49
+ * Permission | Scope | Effect
50
+ * - | - | -
51
+ * none | | Everyone can use this endpoint
52
+ * @returns PagedResult<string>
53
+ */
54
+ getCountries(options?: OptionsBase): Promise<string[]>;
55
+ /**
56
+ * Retrieve a list of all the defined regions for the specified country code
57
+ *
58
+ * Permission | Scope | Effect
59
+ * - | - | -
60
+ * none | | Everyone can use this endpoint
61
+ * @param country The country code (as defined in ISO 3166-1)
62
+ * @returns PagedResult<string>
63
+ * @throws {ResourceUnknownError}
64
+ */
65
+ getRegions(country: string, options?: OptionsBase): Promise<string[]>;
66
+ }
67
+ export interface LanguagesService {
68
+ /**
69
+ * Retrieve a list of all the defined languages
70
+ *
71
+ * Permission | Scope | Effect
72
+ * - | - | -
73
+ * none | | Everyone can use this endpoint
74
+ * @returns PagedResult<SupportedLanguageCodes>
75
+ */
76
+ getLanguages(options?: OptionsBase): Promise<string[]>;
77
+ }
78
+ export interface LocalizationsService {
79
+ /**
80
+ * Returns all possible localizations stored in this service
81
+ *
82
+ * Permission | Scope | Effect
83
+ * - | - | -
84
+ * none | | Everyone can use this endpoint
85
+ * @param rql Add filters to the requested list.
86
+ * @returns PagedResult<Localization>
87
+ */
88
+ find(options?: OptionsWithRql): Promise<PagedResult<Localization>>;
89
+ /**
90
+ * Find By Key
91
+ * @param key the key to search for
92
+ * @param rql an optional rql string
93
+ * @returns the first element found
94
+ */
95
+ findByKey(key: string, options?: OptionsWithRql): Promise<Localization>;
96
+ /**
97
+ * Find First
98
+ * @param rql an optional rql string
99
+ * @returns the first element found
100
+ */
101
+ findFirst(options?: OptionsWithRql): Promise<Localization>;
102
+ /**
103
+ * Create new localizations
104
+ *
105
+ * Permission | Scope | Effect
106
+ * - | - | -
107
+ * `CREATE_LOCALIZATIONS` | global | **Required** for this endpoint
108
+ * @param requestBody BulkLocalization
109
+ * @returns BulkCreationResponse
110
+ * @throws {DefaultLocalizationMissingError}
111
+ */
112
+ create(requestBody: BulkLocalization, options?: OptionsBase): Promise<BulkCreationResponse>;
113
+ /**
114
+ * Update localizations
115
+ *
116
+ * Permission | Scope | Effect
117
+ * - | - | -
118
+ * `UPDATE_LOCALIZATIONS` | global | **Required** for this endpoint
119
+ * @param requestBody BulkLocalization
120
+ * @returns BulkUpdateResponse
121
+ */
122
+ update(requestBody: BulkLocalization, options?: OptionsBase): Promise<BulkUpdateResponse>;
123
+ /**
124
+ * Delete localizations
125
+ *
126
+ * Permission | Scope | Effect
127
+ * - | - | -
128
+ * `DELETE_LOCALIZATIONS` | global | **Required** for this endpoint
129
+ * @param rql Add filters to the requested list, **required**.
130
+ * @returns AffectedRecords
131
+ */
132
+ remove(rql: RQLString, options?: OptionsBase): Promise<AffectedRecords>;
133
+ /**
134
+ * Request localizations of multiple keys in a specific language
135
+ * The default language (EN) is always included in the response as a fallback in case there is no translation available for the specified language
136
+ *
137
+ * Permission | Scope | Effect
138
+ * - | - | -
139
+ * none | | Everyone can use this endpoint
140
+ * @param requestBody LocalizationRequest
141
+ * @returns Record<string, MappedText>
142
+ */
143
+ getByKeys(requestBody: LocalizationRequest, options?: OptionsBase): Promise<Record<string, MappedText>>;
144
+ }
145
+ export {};
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../http/types';
2
+ import { HttpClient } from '../../http-client';
3
+ import { LogsAccessService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => LogsAccessService;
5
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { OptionsWithRql } from '../../types';
2
+ export interface LogsAccessService {
3
+ /**
4
+ * ## Retrieve a list of access logs
5
+ *
6
+ * **Global Permissions:**
7
+ * - `VIEW_ACCESS_LOGS` - Allows a user to view access logs
8
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
9
+ * @returns An array of access logs {@link AccessLog AccessLog[]}
10
+ */
11
+ find(options?: OptionsWithRql): Promise<AccessLog[]>;
12
+ /**
13
+ * ## Retrieve the first queried access log
14
+ *
15
+ * **Global Permissions:**
16
+ * - `VIEW_ACCESS_LOGS` - Allows a user to view access logs
17
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
18
+ * @returns The first element of the queried access logs {@link AccessLog}
19
+ */
20
+ findFirst(options?: OptionsWithRql): Promise<AccessLog>;
21
+ }
22
+ export interface AccessLog {
23
+ /** The time of request receival */
24
+ timestamp: string;
25
+ /** The status code of the response for the request */
26
+ httpStatus: number;
27
+ /** The duration of the request in seconds */
28
+ duration: number;
29
+ /** The Extra Horizon id of the request initiator */
30
+ userId: string;
31
+ /** The IP address of the request's origin */
32
+ userAddress: string;
33
+ /** The domain or IP of the accessed Extra Horizon deployment */
34
+ host: string;
35
+ /** The HTTP request */
36
+ request: string;
37
+ /** The size of the response in Bytes */
38
+ responseBodySize: number;
39
+ /** The signature of the request device and software */
40
+ userAgent: string;
41
+ }
@@ -0,0 +1,3 @@
1
+ import { HttpInstance } from '../../http/types';
2
+ import { LogsService } from './types';
3
+ export declare const logsService: (httpWithAuth: HttpInstance) => LogsService;
@@ -0,0 +1,4 @@
1
+ import { LogsAccessService } from './access/types';
2
+ export interface LogsService {
3
+ access: LogsAccessService;
4
+ }
@@ -0,0 +1,3 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { MailsService } from './types';
3
+ export declare const mailsService: (httpWithAuth: HttpInstance) => MailsService;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { MailsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => MailsService;
5
+ export default _default;
@@ -0,0 +1,141 @@
1
+ import { ObjectId, LanguageCode, MailAddress, MailAddressList, MailRecipients, AffectedRecords, PagedResult, OptionsBase, OptionsWithRql } from '../types';
2
+ export interface Mail {
3
+ id?: ObjectId;
4
+ creatorId?: ObjectId;
5
+ awsMessageId?: ObjectId;
6
+ subject?: string;
7
+ recipients?: MailRecipients;
8
+ templateId?: ObjectId;
9
+ replyTo?: MailAddressList;
10
+ from?: MailAddress;
11
+ body?: string;
12
+ language?: LanguageCode;
13
+ content?: Record<string, any>;
14
+ views?: number;
15
+ creationTimestamp?: Date;
16
+ updateTimestamp?: Date;
17
+ }
18
+ export declare type PlainMailCreation = {
19
+ subject: string;
20
+ body: string;
21
+ } & CommonMailCreationProperties;
22
+ export declare type TemplateBasedMailCreation = {
23
+ templateId: ObjectId;
24
+ language?: LanguageCode;
25
+ content: Record<string, any>;
26
+ } & CommonMailCreationProperties;
27
+ export interface CommonMailCreationProperties {
28
+ recipients: MailRecipients;
29
+ from?: MailAddress;
30
+ replyTo?: MailAddressList;
31
+ attachments?: Attachment[];
32
+ }
33
+ export interface Attachment {
34
+ name: string;
35
+ /**
36
+ * Base64 encoded binary data
37
+ */
38
+ content: string;
39
+ /**
40
+ * MIME Type of the file
41
+ */
42
+ type?: string;
43
+ }
44
+ export interface QueuedMail {
45
+ id?: ObjectId;
46
+ status?: QueuedMailStatus;
47
+ from?: string;
48
+ to?: MailAddressList;
49
+ cc?: MailAddressList;
50
+ bcc?: MailAddressList;
51
+ replyTo?: MailAddress;
52
+ subject?: string;
53
+ text?: string;
54
+ html?: string;
55
+ attachments?: QueuedMailAttachment[];
56
+ encoding?: string;
57
+ textEncoding?: string;
58
+ templateData?: {
59
+ templateId?: ObjectId;
60
+ credentials?: {
61
+ serviceId?: ObjectId;
62
+ applicationId?: ObjectId;
63
+ userId?: ObjectId;
64
+ };
65
+ language?: LanguageCode;
66
+ content?: Record<string, any>;
67
+ };
68
+ }
69
+ export interface QueuedMailAttachment {
70
+ filename?: string;
71
+ content?: string;
72
+ encoding?: string;
73
+ }
74
+ export declare enum QueuedMailStatus {
75
+ QUEUED = "queued",
76
+ SENDING = "sending",
77
+ FAILED = "failed"
78
+ }
79
+ export interface MailsService {
80
+ /**
81
+ * Perform a health check for mail service
82
+ * @returns {boolean} success
83
+ */
84
+ health(options?: OptionsBase): Promise<boolean>;
85
+ /**
86
+ * Retrieve a list of mails
87
+ *
88
+ * Permission | Scope | Effect
89
+ * - | - | -
90
+ * `VIEW_MAILS` | `global` | **Required** for this endpoint
91
+ * @param rql Add filters to the requested list.
92
+ * @returns PagedResult<Mail>
93
+ */
94
+ find: (options?: OptionsWithRql) => Promise<PagedResult<Mail>>;
95
+ /**
96
+ * Find By Id
97
+ * @param id the Id to search for
98
+ * @param rql an optional rql string
99
+ * @returns the first element found
100
+ */
101
+ findById: (id: ObjectId, options?: OptionsWithRql) => Promise<Mail>;
102
+ /**
103
+ * Find First
104
+ * @param rql an optional rql string
105
+ * @returns the first element found
106
+ */
107
+ findFirst(options?: OptionsWithRql): Promise<Mail>;
108
+ /**
109
+ * Send a mail
110
+ *
111
+ * Permission | Scope | Effect
112
+ * - | - | -
113
+ * none | | Send mails to your own email address
114
+ * none | `staff enlistment` | Send any mail to your patients or send a template mail based on pre-configured allowed templates to any email address.
115
+ * `SEND_MAILS` | `global` | Send mails to any email address
116
+ * @param requestBody mail creation data
117
+ * @returns Mail
118
+ * @throws {NotActivatedError}
119
+ */
120
+ send(requestBody: PlainMailCreation | TemplateBasedMailCreation, options?: OptionsBase): Promise<Mail>;
121
+ /**
122
+ * Register a mail being opened
123
+ *
124
+ * Permission | Scope | Effect
125
+ * - | - | -
126
+ * none | | Everyone can use this endpoint
127
+ * @param trackingHash
128
+ * @returns AffectedRecords
129
+ */
130
+ track(trackingHash: string, options?: OptionsBase): Promise<AffectedRecords>;
131
+ /**
132
+ * Retrieve the list of mails that are not sent yet
133
+ *
134
+ * Permission | Scope | Effect
135
+ * - | - | -
136
+ * `VIEW_MAILS` | `global` | **Required** for this endpoint
137
+ * @param rql Add filters to the requested list.
138
+ * @returns PagedResult<QueuedMail>
139
+ */
140
+ findOutbound(options?: OptionsWithRql): Promise<PagedResult<QueuedMail>>;
141
+ }
@@ -0,0 +1,9 @@
1
+ import type { HttpInstance } from '../../types';
2
+ declare const _default: (client: any, http: HttpInstance) => {
3
+ /**
4
+ * Perform a health check
5
+ * @returns {boolean} success
6
+ */
7
+ health(): Promise<boolean>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { AuthHttpClient } from '../../types';
2
+ import health from './health';
3
+ import settings from './settings';
4
+ import { NotificationSettingsServices, NotificationsService } from './types';
5
+ export declare const notificationsService: (httpWithAuth: AuthHttpClient) => NotificationsService & ReturnType<typeof health> & {
6
+ settings: NotificationSettingsServices;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { AuthHttpClient } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { NotificationsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: AuthHttpClient) => NotificationsService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { NotificationSettingsServices } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => NotificationSettingsServices;
5
+ export default _default;
@@ -0,0 +1,222 @@
1
+ import { FindAllIterator } from '../../services/helpers';
2
+ import { AffectedRecords, ObjectId, OptionsBase, OptionsWithRql, PagedResult, PagedResultWithPager } from '../types';
3
+ export interface Notification {
4
+ id?: ObjectId;
5
+ type?: string;
6
+ viewed?: boolean;
7
+ userId?: ObjectId;
8
+ fields?: Record<string, string>;
9
+ important?: boolean;
10
+ creationTimestamp?: Date;
11
+ updateTimestamp?: Date;
12
+ }
13
+ interface CreateNotificationRequestBase {
14
+ userId?: ObjectId;
15
+ important?: boolean;
16
+ }
17
+ interface CreateNotificationRequestMessage extends CreateNotificationRequestBase {
18
+ type: 'message';
19
+ fields: {
20
+ title: string;
21
+ body: string;
22
+ };
23
+ }
24
+ interface CreateNotificationRequestLink extends CreateNotificationRequestBase {
25
+ type: 'link';
26
+ fields: {
27
+ title: string;
28
+ body: string;
29
+ url: string;
30
+ };
31
+ }
32
+ interface CreateNotificationRequestMeasurementComment extends CreateNotificationRequestBase {
33
+ type: 'measurement_comment';
34
+ fields: {
35
+ commenterId: ObjectId;
36
+ measurementId: ObjectId;
37
+ };
38
+ }
39
+ interface CreateNotificationRequestMeasurementReviewed extends CreateNotificationRequestBase {
40
+ type: 'measurement_reviewed';
41
+ fields: {
42
+ measurementId: ObjectId;
43
+ };
44
+ }
45
+ interface CreateNotificationRequestMeasurementPrescriptionExpiry extends CreateNotificationRequestBase {
46
+ type: 'prescription_expiry';
47
+ fields: {
48
+ groupId: ObjectId;
49
+ groupName: string;
50
+ };
51
+ }
52
+ interface CreateNotificationRequestActivated extends CreateNotificationRequestBase {
53
+ type: 'activated';
54
+ }
55
+ interface CreateNotificationRequestPasswordChanged extends CreateNotificationRequestBase {
56
+ type: 'password_changed';
57
+ }
58
+ export declare type CreateNotificationRequest = CreateNotificationRequestMessage | CreateNotificationRequestLink | CreateNotificationRequestMeasurementComment | CreateNotificationRequestMeasurementReviewed | CreateNotificationRequestMeasurementPrescriptionExpiry | CreateNotificationRequestActivated | CreateNotificationRequestPasswordChanged;
59
+ export interface NotifTypeDef {
60
+ name?: string;
61
+ requiredFields?: Record<string, FieldType>;
62
+ optionalFields?: Record<string, {
63
+ fieldType?: FieldType;
64
+ defaultValue?: string;
65
+ }>;
66
+ title?: string;
67
+ body?: string;
68
+ combinedBody?: string;
69
+ pushByDefault?: boolean;
70
+ }
71
+ export declare enum FieldType {
72
+ STRING = "STRING",
73
+ NUMBER = "NUMBER",
74
+ BOOLEAN = "BOOLEAN",
75
+ OBJECT_ID = "OBJECT_ID",
76
+ URL = "URL"
77
+ }
78
+ export interface Setting {
79
+ id?: ObjectId;
80
+ key?: string;
81
+ preferences?: Record<string, boolean>;
82
+ creationTimestamp?: Date;
83
+ updateTimestamp?: Date;
84
+ }
85
+ export declare type SettingCreation = Required<Pick<Setting, 'key' | 'preferences'>>;
86
+ export interface NotificationsService {
87
+ /**
88
+ * Create a notification
89
+ *
90
+ * Permission | Scope | Effect
91
+ * - | - | -
92
+ * none | | Create a notification for yourself
93
+ * `CREATE_NOTIFICATIONS` | `global` | Create a notification for another person
94
+ * @param requestBody CreateNotificationRequest
95
+ * @returns Notification
96
+ */
97
+ create(requestBody: CreateNotificationRequest, options?: OptionsBase): Promise<Notification>;
98
+ /**
99
+ * Retrieve a list of notifications
100
+ *
101
+ * Permission | Scope | Effect
102
+ * - | - | -
103
+ * none | | View your own notifications
104
+ * `VIEW_NOTIFICATIONS` | `global` | View all notifications
105
+ * @param rql Add filters to the requested list.
106
+ * @returns PagedResult<Notification>
107
+ */
108
+ find(options?: OptionsWithRql): Promise<PagedResultWithPager<Notification>>;
109
+ /**
110
+ * Request a list of all notifications
111
+ *
112
+ * Do not pass in an rql with limit operator!
113
+ *
114
+ * Permission | Scope | Effect
115
+ * - | - | -
116
+ * none | | View your own notifications
117
+ * `VIEW_NOTIFICATIONS` | `global` | View all notifications
118
+ * @returns Notification[]
119
+ */
120
+ findAll(options?: OptionsWithRql): Promise<Notification[]>;
121
+ /**
122
+ * Request a list of all notifications
123
+ *
124
+ * Permission | Scope | Effect
125
+ * - | - | -
126
+ * none | | View your own notifications
127
+ * `VIEW_NOTIFICATIONS` | `global` | View all notifications
128
+ * @returns Notification[]
129
+ */
130
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<Notification>;
131
+ /**
132
+ * Find By Id
133
+ * @param id the Id to search for
134
+ * @param rql an optional rql string
135
+ * @returns the first element found
136
+ */
137
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<Notification>;
138
+ /**
139
+ * Find First
140
+ * @param rql an optional rql string
141
+ * @returns the first element found
142
+ */
143
+ findFirst(options?: OptionsWithRql): Promise<Notification>;
144
+ /**
145
+ * Delete notification(s)
146
+ *
147
+ * Permission | Scope | Effect
148
+ * - | - | -
149
+ * `DELETE_NOTIFICATIONS` | `global` | **Required** for this endpoint
150
+ * @param rql Add filters to the requested list.
151
+ * @returns AffectedRecords
152
+ */
153
+ remove(options?: OptionsWithRql): Promise<AffectedRecords>;
154
+ /**
155
+ * Mark your notification(s) as viewed
156
+ *
157
+ * Permission | Scope | Effect
158
+ * - | - | -
159
+ * none | | Everyone can use this endpoint
160
+ * @param rql Add filters to the requested list.
161
+ * @returns AffectedRecords
162
+ */
163
+ markAsViewed(options?: OptionsWithRql): Promise<AffectedRecords>;
164
+ /**
165
+ * Retrieve the list of notification types
166
+ *
167
+ * Permission | Scope | Effect
168
+ * - | - | -
169
+ * none | | Everyone can use this endpoint
170
+ * @returns PagedResult<NotifTypeDef>
171
+ */
172
+ getTypes(options?: OptionsBase): Promise<PagedResult<NotifTypeDef>>;
173
+ }
174
+ export interface NotificationSettingsServices {
175
+ /**
176
+ * Retrieve a list of notifications settings
177
+ *
178
+ * Permission | Scope | Effect
179
+ * - | - | -
180
+ * none | | View your own notification settings
181
+ * `VIEW_NOTIFICATION_SETTINGS` | `global` | View all notification settings
182
+ * @param rql Add filters to the requested list.
183
+ * @returns PagedResult<Setting>
184
+ */
185
+ find(options?: OptionsWithRql): Promise<PagedResult<Setting>>;
186
+ /**
187
+ * Find By Id
188
+ * @param id the Id to search for
189
+ * @param rql an optional rql string
190
+ * @returns the first element found
191
+ */
192
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<Setting>;
193
+ /**
194
+ * Find First
195
+ * @param rql an optional rql string
196
+ * @returns the first element found
197
+ */
198
+ findFirst(options?: OptionsWithRql): Promise<Setting>;
199
+ /**
200
+ * Update the notification settings for a user
201
+ *
202
+ * Permission | Scope | Effect
203
+ * - | - | -
204
+ * none | | Update your own notification settings
205
+ * `UPDATE_NOTIFICATION_SETTINGS` | `global` | Update all notification settings
206
+ * @param userId The User Id
207
+ * @param requestBody SettingCreation object
208
+ * @returns Setting
209
+ */
210
+ update(userId: string, requestBody: SettingCreation, options?: OptionsBase): Promise<Setting>;
211
+ /**
212
+ * Delete the notifications settings for a user
213
+ *
214
+ * Permission | Scope | Effect
215
+ * - | - | -
216
+ * `UPDATE_NOTIFICATION_SETTINGS` | `global` | **Required** for this endpoint
217
+ * @param userId
218
+ * @returns AffectedRecords
219
+ */
220
+ remove(userId: string, options?: OptionsBase): Promise<AffectedRecords>;
221
+ }
222
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { PaymentsAppStoreService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => PaymentsAppStoreService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { PaymentsAppStoreSubscriptionsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => PaymentsAppStoreSubscriptionsService;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { HttpInstance } from '../../types';
2
+ declare const _default: (client: any, httpAuth: HttpInstance) => {
3
+ /**
4
+ * Check if the service is available
5
+ * @returns true if service is up and running
6
+ */
7
+ health(): Promise<boolean>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import health from './health';
3
+ import { PaymentsAppStoreService, PaymentsAppStoreSubscriptionsService, PaymentsOrdersService, PaymentsProductsService, PaymentsStripeService, PaymentsSubscriptionsService, PaymentsPlayStoreService, PaymentsPlayStoreSubscriptionsService, PaymentsPlayStoreHistoryService } from './types';
4
+ export declare type PaymentsService = ReturnType<typeof health> & {
5
+ products: PaymentsProductsService;
6
+ orders: PaymentsOrdersService;
7
+ subscriptions: PaymentsSubscriptionsService;
8
+ appStore: PaymentsAppStoreService;
9
+ appStoreSubscriptions: PaymentsAppStoreSubscriptionsService;
10
+ playStore: PaymentsPlayStoreService;
11
+ playStoreHistory: PaymentsPlayStoreHistoryService;
12
+ playStoreSubscriptions: PaymentsPlayStoreSubscriptionsService;
13
+ stripe: PaymentsStripeService;
14
+ };
15
+ export declare const paymentsService: (httpWithAuth: HttpInstance) => PaymentsService;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { PaymentsOrdersService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => PaymentsOrdersService;
5
+ export default _default;