@notiflows/node 0.0.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.
- package/LICENSE +201 -0
- package/README.md +422 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +207 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +207 -0
- package/client.d.ts.map +1 -0
- package/client.js +502 -0
- package/client.js.map +1 -0
- package/client.mjs +498 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +59 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +59 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +147 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/deliveries.d.mts +143 -0
- package/resources/deliveries.d.mts.map +1 -0
- package/resources/deliveries.d.ts +143 -0
- package/resources/deliveries.d.ts.map +1 -0
- package/resources/deliveries.js +44 -0
- package/resources/deliveries.js.map +1 -0
- package/resources/deliveries.mjs +40 -0
- package/resources/deliveries.mjs.map +1 -0
- package/resources/index.d.mts +6 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +15 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -0
- package/resources/notifications.d.mts +170 -0
- package/resources/notifications.d.mts.map +1 -0
- package/resources/notifications.d.ts +170 -0
- package/resources/notifications.d.ts.map +1 -0
- package/resources/notifications.js +58 -0
- package/resources/notifications.js.map +1 -0
- package/resources/notifications.mjs +54 -0
- package/resources/notifications.mjs.map +1 -0
- package/resources/notiflows.d.mts +122 -0
- package/resources/notiflows.d.mts.map +1 -0
- package/resources/notiflows.d.ts +122 -0
- package/resources/notiflows.d.ts.map +1 -0
- package/resources/notiflows.js +36 -0
- package/resources/notiflows.js.map +1 -0
- package/resources/notiflows.mjs +32 -0
- package/resources/notiflows.mjs.map +1 -0
- package/resources/topics/index.d.mts +3 -0
- package/resources/topics/index.d.mts.map +1 -0
- package/resources/topics/index.d.ts +3 -0
- package/resources/topics/index.d.ts.map +1 -0
- package/resources/topics/index.js +9 -0
- package/resources/topics/index.js.map +1 -0
- package/resources/topics/index.mjs +4 -0
- package/resources/topics/index.mjs.map +1 -0
- package/resources/topics/subscriptions.d.mts +137 -0
- package/resources/topics/subscriptions.d.mts.map +1 -0
- package/resources/topics/subscriptions.d.ts +137 -0
- package/resources/topics/subscriptions.d.ts.map +1 -0
- package/resources/topics/subscriptions.js +78 -0
- package/resources/topics/subscriptions.js.map +1 -0
- package/resources/topics/subscriptions.mjs +74 -0
- package/resources/topics/subscriptions.mjs.map +1 -0
- package/resources/topics/topics.d.mts +70 -0
- package/resources/topics/topics.d.mts.map +1 -0
- package/resources/topics/topics.d.ts +70 -0
- package/resources/topics/topics.d.ts.map +1 -0
- package/resources/topics/topics.js +65 -0
- package/resources/topics/topics.js.map +1 -0
- package/resources/topics/topics.mjs +60 -0
- package/resources/topics/topics.mjs.map +1 -0
- package/resources/topics.d.mts +2 -0
- package/resources/topics.d.mts.map +1 -0
- package/resources/topics.d.ts +2 -0
- package/resources/topics.d.ts.map +1 -0
- package/resources/topics.js +6 -0
- package/resources/topics.js.map +1 -0
- package/resources/topics.mjs +3 -0
- package/resources/topics.mjs.map +1 -0
- package/resources/users/channel-settings.d.mts +158 -0
- package/resources/users/channel-settings.d.mts.map +1 -0
- package/resources/users/channel-settings.d.ts +158 -0
- package/resources/users/channel-settings.d.ts.map +1 -0
- package/resources/users/channel-settings.js +98 -0
- package/resources/users/channel-settings.js.map +1 -0
- package/resources/users/channel-settings.mjs +94 -0
- package/resources/users/channel-settings.mjs.map +1 -0
- package/resources/users/deliveries.d.mts +71 -0
- package/resources/users/deliveries.d.mts.map +1 -0
- package/resources/users/deliveries.d.ts +71 -0
- package/resources/users/deliveries.d.ts.map +1 -0
- package/resources/users/deliveries.js +45 -0
- package/resources/users/deliveries.js.map +1 -0
- package/resources/users/deliveries.mjs +41 -0
- package/resources/users/deliveries.mjs.map +1 -0
- package/resources/users/index.d.mts +7 -0
- package/resources/users/index.d.mts.map +1 -0
- package/resources/users/index.d.ts +7 -0
- package/resources/users/index.d.ts.map +1 -0
- package/resources/users/index.js +17 -0
- package/resources/users/index.js.map +1 -0
- package/resources/users/index.mjs +8 -0
- package/resources/users/index.mjs.map +1 -0
- package/resources/users/notifications.d.mts +68 -0
- package/resources/users/notifications.d.mts.map +1 -0
- package/resources/users/notifications.d.ts +68 -0
- package/resources/users/notifications.d.ts.map +1 -0
- package/resources/users/notifications.js +43 -0
- package/resources/users/notifications.js.map +1 -0
- package/resources/users/notifications.mjs +39 -0
- package/resources/users/notifications.mjs.map +1 -0
- package/resources/users/preferences.d.mts +166 -0
- package/resources/users/preferences.d.mts.map +1 -0
- package/resources/users/preferences.d.ts +166 -0
- package/resources/users/preferences.d.ts.map +1 -0
- package/resources/users/preferences.js +60 -0
- package/resources/users/preferences.js.map +1 -0
- package/resources/users/preferences.mjs +56 -0
- package/resources/users/preferences.mjs.map +1 -0
- package/resources/users/subscriptions.d.mts +121 -0
- package/resources/users/subscriptions.d.mts.map +1 -0
- package/resources/users/subscriptions.d.ts +121 -0
- package/resources/users/subscriptions.d.ts.map +1 -0
- package/resources/users/subscriptions.js +84 -0
- package/resources/users/subscriptions.js.map +1 -0
- package/resources/users/subscriptions.mjs +80 -0
- package/resources/users/subscriptions.mjs.map +1 -0
- package/resources/users/users.d.mts +216 -0
- package/resources/users/users.d.mts.map +1 -0
- package/resources/users/users.d.ts +216 -0
- package/resources/users/users.d.ts.map +1 -0
- package/resources/users/users.js +102 -0
- package/resources/users/users.js.map +1 -0
- package/resources/users/users.mjs +97 -0
- package/resources/users/users.mjs.map +1 -0
- package/resources/users.d.mts +2 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +2 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +6 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +838 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +163 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/deliveries.ts +183 -0
- package/src/resources/index.ts +19 -0
- package/src/resources/notifications.ts +225 -0
- package/src/resources/notiflows.ts +155 -0
- package/src/resources/topics/index.ts +11 -0
- package/src/resources/topics/subscriptions.ts +182 -0
- package/src/resources/topics/topics.ts +115 -0
- package/src/resources/topics.ts +3 -0
- package/src/resources/users/channel-settings.ts +205 -0
- package/src/resources/users/deliveries.ts +103 -0
- package/src/resources/users/index.ts +23 -0
- package/src/resources/users/notifications.ts +100 -0
- package/src/resources/users/preferences.ts +182 -0
- package/src/resources/users/subscriptions.ts +179 -0
- package/src/resources/users/users.ts +324 -0
- package/src/resources/users.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { NotiflowsError } from '../../core/error';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
5
|
+
*
|
|
6
|
+
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
7
|
+
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
8
|
+
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
9
|
+
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
10
|
+
*/
|
|
11
|
+
export function encodeURIPath(str: string) {
|
|
12
|
+
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
16
|
+
|
|
17
|
+
export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
18
|
+
function path(statics: readonly string[], ...params: readonly unknown[]): string {
|
|
19
|
+
// If there are no params, no processing is needed.
|
|
20
|
+
if (statics.length === 1) return statics[0]!;
|
|
21
|
+
|
|
22
|
+
let postPath = false;
|
|
23
|
+
const invalidSegments = [];
|
|
24
|
+
const path = statics.reduce((previousValue, currentValue, index) => {
|
|
25
|
+
if (/[?#]/.test(currentValue)) {
|
|
26
|
+
postPath = true;
|
|
27
|
+
}
|
|
28
|
+
const value = params[index];
|
|
29
|
+
let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
|
|
30
|
+
if (
|
|
31
|
+
index !== params.length &&
|
|
32
|
+
(value == null ||
|
|
33
|
+
(typeof value === 'object' &&
|
|
34
|
+
// handle values from other realms
|
|
35
|
+
value.toString ===
|
|
36
|
+
Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY)
|
|
37
|
+
?.toString))
|
|
38
|
+
) {
|
|
39
|
+
encoded = value + '';
|
|
40
|
+
invalidSegments.push({
|
|
41
|
+
start: previousValue.length + currentValue.length,
|
|
42
|
+
length: encoded.length,
|
|
43
|
+
error: `Value of type ${Object.prototype.toString
|
|
44
|
+
.call(value)
|
|
45
|
+
.slice(8, -1)} is not a valid path parameter`,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
49
|
+
}, '');
|
|
50
|
+
|
|
51
|
+
const pathOnly = path.split(/[?#]/, 1)[0]!;
|
|
52
|
+
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
53
|
+
let match;
|
|
54
|
+
|
|
55
|
+
// Find all invalid segments
|
|
56
|
+
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
57
|
+
invalidSegments.push({
|
|
58
|
+
start: match.index,
|
|
59
|
+
length: match[0].length,
|
|
60
|
+
error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
invalidSegments.sort((a, b) => a.start - b.start);
|
|
65
|
+
|
|
66
|
+
if (invalidSegments.length > 0) {
|
|
67
|
+
let lastEnd = 0;
|
|
68
|
+
const underline = invalidSegments.reduce((acc, segment) => {
|
|
69
|
+
const spaces = ' '.repeat(segment.start - lastEnd);
|
|
70
|
+
const arrows = '^'.repeat(segment.length);
|
|
71
|
+
lastEnd = segment.start + segment.length;
|
|
72
|
+
return acc + spaces + arrows;
|
|
73
|
+
}, '');
|
|
74
|
+
|
|
75
|
+
throw new NotiflowsError(
|
|
76
|
+
`Path parameters result in path with invalid segments:\n${invalidSegments
|
|
77
|
+
.map((e) => e.error)
|
|
78
|
+
.join('\n')}\n${path}\n${underline}`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return path;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
87
|
+
*/
|
|
88
|
+
export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* https://stackoverflow.com/a/2117523
|
|
5
|
+
*/
|
|
6
|
+
export let uuid4 = function () {
|
|
7
|
+
const { crypto } = globalThis as any;
|
|
8
|
+
if (crypto?.randomUUID) {
|
|
9
|
+
uuid4 = crypto.randomUUID.bind(crypto);
|
|
10
|
+
return crypto.randomUUID();
|
|
11
|
+
}
|
|
12
|
+
const u8 = new Uint8Array(1);
|
|
13
|
+
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
|
|
14
|
+
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
15
|
+
(+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { NotiflowsError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
6
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
7
|
+
|
|
8
|
+
export const isAbsoluteURL = (url: string): boolean => {
|
|
9
|
+
return startsWithSchemeRegexp.test(url);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
|
|
13
|
+
export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
|
|
14
|
+
|
|
15
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
16
|
+
export function maybeObj(x: unknown): object {
|
|
17
|
+
if (typeof x !== 'object') {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return x ?? {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// https://stackoverflow.com/a/34491287
|
|
25
|
+
export function isEmptyObj(obj: Object | null | undefined): boolean {
|
|
26
|
+
if (!obj) return true;
|
|
27
|
+
for (const _k in obj) return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
32
|
+
export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
|
|
33
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isObj(obj: unknown): obj is Record<string, unknown> {
|
|
37
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
throw new NotiflowsError(`Expected a value to be given but received ${value} instead.`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const validatePositiveInteger = (name: string, n: unknown): number => {
|
|
49
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
50
|
+
throw new NotiflowsError(`${name} must be an integer`);
|
|
51
|
+
}
|
|
52
|
+
if (n < 0) {
|
|
53
|
+
throw new NotiflowsError(`${name} must be a positive integer`);
|
|
54
|
+
}
|
|
55
|
+
return n;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const coerceInteger = (value: unknown): number => {
|
|
59
|
+
if (typeof value === 'number') return Math.round(value);
|
|
60
|
+
if (typeof value === 'string') return parseInt(value, 10);
|
|
61
|
+
|
|
62
|
+
throw new NotiflowsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const coerceFloat = (value: unknown): number => {
|
|
66
|
+
if (typeof value === 'number') return value;
|
|
67
|
+
if (typeof value === 'string') return parseFloat(value);
|
|
68
|
+
|
|
69
|
+
throw new NotiflowsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const coerceBoolean = (value: unknown): boolean => {
|
|
73
|
+
if (typeof value === 'boolean') return value;
|
|
74
|
+
if (typeof value === 'string') return value === 'true';
|
|
75
|
+
return Boolean(value);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
79
|
+
if (value == null) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return coerceInteger(value);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
86
|
+
if (value == null) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return coerceFloat(value);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
return coerceBoolean(value);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const safeJSON = (text: string) => {
|
|
100
|
+
try {
|
|
101
|
+
return JSON.parse(text);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './utils/values';
|
|
4
|
+
export * from './utils/base64';
|
|
5
|
+
export * from './utils/env';
|
|
6
|
+
export * from './utils/log';
|
|
7
|
+
export * from './utils/uuid';
|
|
8
|
+
export * from './utils/sleep';
|
package/src/lib/.keep
ADDED
package/src/resource.ts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Deliveries extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve details of a single delivery attempt.
|
|
12
|
+
*
|
|
13
|
+
* Includes the rendered content (`data`), channel information, and all timestamp
|
|
14
|
+
* tracking (sent, seen, read, clicked, archived).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const delivery = await client.deliveries.retrieve(
|
|
19
|
+
* '01HQXYZ123456789ABCDEFGHIJ',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Delivery> {
|
|
24
|
+
return this._client.get(path`/deliveries/${id}`, options);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a paginated list of all deliveries in your project.
|
|
29
|
+
*
|
|
30
|
+
* A delivery represents a single attempt to send a notification through a specific
|
|
31
|
+
* channel. Use filters to narrow down results by channel, status, or time range.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const delivery of client.deliveries.list()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
list(
|
|
42
|
+
query: DeliveryListParams | null | undefined = {},
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): PagePromise<DeliveriesCursorPage, Delivery> {
|
|
45
|
+
return this._client.getAPIList('/deliveries', CursorPage<Delivery>, { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type DeliveriesCursorPage = CursorPage<Delivery>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A single delivery attempt through a specific channel
|
|
53
|
+
*/
|
|
54
|
+
export interface Delivery {
|
|
55
|
+
/**
|
|
56
|
+
* Delivery ID
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Type of channel used for this delivery
|
|
62
|
+
*/
|
|
63
|
+
channel_type: 'in_app' | 'email' | 'sms' | 'chat' | 'web_push' | 'mobile_push';
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When the delivery was created
|
|
67
|
+
*/
|
|
68
|
+
created_at: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* ID of the parent notification
|
|
72
|
+
*/
|
|
73
|
+
notification_id: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* ID of the notiflow
|
|
77
|
+
*/
|
|
78
|
+
notiflow_id: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Internal ID of the recipient
|
|
82
|
+
*/
|
|
83
|
+
recipient_id: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Delivery status:
|
|
87
|
+
*
|
|
88
|
+
* - `pending`: Queued for sending
|
|
89
|
+
* - `sent`: Successfully sent to the provider
|
|
90
|
+
* - `failed`: Delivery failed
|
|
91
|
+
*/
|
|
92
|
+
status: 'pending' | 'sent' | 'failed';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* When the delivery was last updated
|
|
96
|
+
*/
|
|
97
|
+
updated_at: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Internal ID of the actor
|
|
101
|
+
*/
|
|
102
|
+
actor_id?: string | null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* When the recipient archived it
|
|
106
|
+
*/
|
|
107
|
+
archived_at?: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* ID of the channel used for delivery
|
|
111
|
+
*/
|
|
112
|
+
channel_id?: string | null;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* When the recipient clicked/interacted
|
|
116
|
+
*/
|
|
117
|
+
clicked_at?: string | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Rendered notification content (varies by channel type)
|
|
121
|
+
*/
|
|
122
|
+
data?: unknown;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* When the recipient marked it as read
|
|
126
|
+
*/
|
|
127
|
+
read_at?: string | null;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* When the recipient saw the notification
|
|
131
|
+
*/
|
|
132
|
+
seen_at?: string | null;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* When the delivery was sent to the provider
|
|
136
|
+
*/
|
|
137
|
+
sent_at?: string | null;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Topic name if triggered via topic
|
|
141
|
+
*/
|
|
142
|
+
topic?: string | null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface DeliveryListParams extends CursorPageParams {
|
|
146
|
+
/**
|
|
147
|
+
* Cursor for fetching the previous page
|
|
148
|
+
*/
|
|
149
|
+
before?: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Filter by channel ID (UUID)
|
|
153
|
+
*/
|
|
154
|
+
channel_id?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Filter by created after (ISO 8601 datetime)
|
|
158
|
+
*/
|
|
159
|
+
created_after?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Filter by created before (ISO 8601 datetime)
|
|
163
|
+
*/
|
|
164
|
+
created_before?: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Filter by status (pending, sent, failed)
|
|
168
|
+
*/
|
|
169
|
+
status?: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Filter by topic name
|
|
173
|
+
*/
|
|
174
|
+
topic?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export declare namespace Deliveries {
|
|
178
|
+
export {
|
|
179
|
+
type Delivery as Delivery,
|
|
180
|
+
type DeliveriesCursorPage as DeliveriesCursorPage,
|
|
181
|
+
type DeliveryListParams as DeliveryListParams,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Deliveries, type Delivery, type DeliveryListParams, type DeliveriesCursorPage } from './deliveries';
|
|
4
|
+
export {
|
|
5
|
+
Notifications,
|
|
6
|
+
type Notification,
|
|
7
|
+
type NotificationListParams,
|
|
8
|
+
type NotificationListDeliveriesParams,
|
|
9
|
+
type NotificationsCursorPage,
|
|
10
|
+
} from './notifications';
|
|
11
|
+
export { NotiflowsResource, type NotiflowRunResponse, type NotiflowRunParams } from './notiflows';
|
|
12
|
+
export { Topics, type Topic, type TopicListParams, type TopicsCursorPage } from './topics/topics';
|
|
13
|
+
export {
|
|
14
|
+
Users,
|
|
15
|
+
type User,
|
|
16
|
+
type UserListParams,
|
|
17
|
+
type UserUpsertParams,
|
|
18
|
+
type UsersCursorPage,
|
|
19
|
+
} from './users/users';
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as DeliveriesAPI from './deliveries';
|
|
5
|
+
import { DeliveriesCursorPage } from './deliveries';
|
|
6
|
+
import * as UsersAPI from './users/users';
|
|
7
|
+
import { APIPromise } from '../core/api-promise';
|
|
8
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
9
|
+
import { RequestOptions } from '../internal/request-options';
|
|
10
|
+
import { path } from '../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
export class Notifications extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a single notification by ID, including the recipient, actor, and all
|
|
15
|
+
* delivery attempts.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const notification = await client.notifications.retrieve(
|
|
20
|
+
* '01HQXYZ123456789ABCDEFGHIJ',
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Notification> {
|
|
25
|
+
return this._client.get(path`/notifications/${id}`, options);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a paginated list of all notifications in your project.
|
|
30
|
+
*
|
|
31
|
+
* A notification represents a message sent to a single recipient through a
|
|
32
|
+
* notiflow run. Each notification can have multiple deliveries (one per channel).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Automatically fetches more pages as needed.
|
|
37
|
+
* for await (const notification of client.notifications.list()) {
|
|
38
|
+
* // ...
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
list(
|
|
43
|
+
query: NotificationListParams | null | undefined = {},
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): PagePromise<NotificationsCursorPage, Notification> {
|
|
46
|
+
return this._client.getAPIList('/notifications', CursorPage<Notification>, { query, ...options });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve all delivery attempts for a specific notification.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Automatically fetches more pages as needed.
|
|
55
|
+
* for await (const delivery of client.notifications.listDeliveries(
|
|
56
|
+
* '01HQXYZ123456789ABCDEFGHIJ',
|
|
57
|
+
* )) {
|
|
58
|
+
* // ...
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
listDeliveries(
|
|
63
|
+
notificationID: string,
|
|
64
|
+
query: NotificationListDeliveriesParams | null | undefined = {},
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): PagePromise<DeliveriesCursorPage, DeliveriesAPI.Delivery> {
|
|
67
|
+
return this._client.getAPIList(
|
|
68
|
+
path`/notifications/${notificationID}/deliveries`,
|
|
69
|
+
CursorPage<DeliveriesAPI.Delivery>,
|
|
70
|
+
{ query, ...options },
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type NotificationsCursorPage = CursorPage<Notification>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A notification sent to a recipient through a notiflow run
|
|
79
|
+
*/
|
|
80
|
+
export interface Notification {
|
|
81
|
+
/**
|
|
82
|
+
* Notification ID
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* When the notification was created
|
|
88
|
+
*/
|
|
89
|
+
created_at: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Template variables passed when running the notiflow
|
|
93
|
+
*/
|
|
94
|
+
data: unknown;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* ID of the notiflow that generated this notification
|
|
98
|
+
*/
|
|
99
|
+
notiflow_id: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* ID of the specific notiflow run
|
|
103
|
+
*/
|
|
104
|
+
notiflow_run_id: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Internal ID of the recipient user
|
|
108
|
+
*/
|
|
109
|
+
recipient_id: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Notification processing status:
|
|
113
|
+
*
|
|
114
|
+
* - `pending`: Queued for processing
|
|
115
|
+
* - `processing`: Currently being processed
|
|
116
|
+
* - `processed`: Successfully processed (deliveries created)
|
|
117
|
+
* - `failed`: Processing failed
|
|
118
|
+
*/
|
|
119
|
+
status: 'pending' | 'processing' | 'processed' | 'failed';
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* When the notification was last updated
|
|
123
|
+
*/
|
|
124
|
+
updated_at: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A user (recipient) in your project
|
|
128
|
+
*/
|
|
129
|
+
actor?: UsersAPI.User | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Internal ID of the actor (user who triggered the notification)
|
|
133
|
+
*/
|
|
134
|
+
actor_id?: string | null;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Delivery attempts for this notification (when expanded)
|
|
138
|
+
*/
|
|
139
|
+
deliveries?: Array<DeliveriesAPI.Delivery>;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* When the notification was processed
|
|
143
|
+
*/
|
|
144
|
+
processed_at?: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A user (recipient) in your project
|
|
148
|
+
*/
|
|
149
|
+
recipient?: UsersAPI.User;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Topic name if triggered via topic
|
|
153
|
+
*/
|
|
154
|
+
topic?: string | null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface NotificationListParams extends CursorPageParams {
|
|
158
|
+
/**
|
|
159
|
+
* Cursor for fetching the previous page
|
|
160
|
+
*/
|
|
161
|
+
before?: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Filter by created after (ISO 8601 datetime)
|
|
165
|
+
*/
|
|
166
|
+
created_after?: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Filter by created before (ISO 8601 datetime)
|
|
170
|
+
*/
|
|
171
|
+
created_before?: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Filter by status
|
|
175
|
+
*/
|
|
176
|
+
status?: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Filter by topic
|
|
180
|
+
*/
|
|
181
|
+
topic?: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface NotificationListDeliveriesParams extends CursorPageParams {
|
|
185
|
+
/**
|
|
186
|
+
* Cursor for fetching the previous page
|
|
187
|
+
*/
|
|
188
|
+
before?: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Filter by channel ID (UUID)
|
|
192
|
+
*/
|
|
193
|
+
channel_id?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Filter by created after (ISO 8601 datetime)
|
|
197
|
+
*/
|
|
198
|
+
created_after?: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Filter by created before (ISO 8601 datetime)
|
|
202
|
+
*/
|
|
203
|
+
created_before?: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Filter by status (pending, sent, failed)
|
|
207
|
+
*/
|
|
208
|
+
status?: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Filter by topic name
|
|
212
|
+
*/
|
|
213
|
+
topic?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare namespace Notifications {
|
|
217
|
+
export {
|
|
218
|
+
type Notification as Notification,
|
|
219
|
+
type NotificationsCursorPage as NotificationsCursorPage,
|
|
220
|
+
type NotificationListParams as NotificationListParams,
|
|
221
|
+
type NotificationListDeliveriesParams as NotificationListDeliveriesParams,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export { type DeliveriesCursorPage };
|