@aurabase/aurabase-js 0.3.0 → 0.3.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/package.json +4 -4
- package/packages/ai/node_modules/.bin/esbuild +0 -19
- package/packages/ai/node_modules/.bin/tsc +0 -22
- package/packages/ai/node_modules/.bin/tsserver +0 -22
- package/packages/ai/node_modules/.bin/tsup +0 -22
- package/packages/ai/node_modules/.bin/tsup-node +0 -22
- package/packages/ai/node_modules/.bin/vite +0 -22
- package/packages/ai/node_modules/.bin/vitest +0 -22
- package/packages/ai/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/ai/src/AiService.ts +0 -226
- package/packages/ai/src/index.ts +0 -18
- package/packages/ai/src/sse.ts +0 -141
- package/packages/ai/src/types.ts +0 -30
- package/packages/ai/tests/chat-stream.test.ts +0 -151
- package/packages/ai/tests/rag-namespaces.test.ts +0 -54
- package/packages/ai/tests/sse.test.ts +0 -69
- package/packages/ai/tsconfig.json +0 -5
- package/packages/ai/tsup.config.ts +0 -11
- package/packages/aurabase/node_modules/.bin/esbuild +0 -19
- package/packages/aurabase/node_modules/.bin/tsc +0 -22
- package/packages/aurabase/node_modules/.bin/tsserver +0 -22
- package/packages/aurabase/node_modules/.bin/tsup +0 -22
- package/packages/aurabase/node_modules/.bin/tsup-node +0 -22
- package/packages/aurabase/node_modules/.bin/vite +0 -22
- package/packages/aurabase/node_modules/.bin/vitest +0 -22
- package/packages/aurabase/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/aurabase/src/AuraClient.ts +0 -237
- package/packages/aurabase/src/index.ts +0 -152
- package/packages/aurabase/src/ssr.ts +0 -156
- package/packages/aurabase/tests/ai-streaming-rag-e2e.test.ts +0 -82
- package/packages/aurabase/tests/ai.test.ts +0 -111
- package/packages/aurabase/tests/auth-admin.test.ts +0 -515
- package/packages/aurabase/tests/auth-e2e.test.ts +0 -135
- package/packages/aurabase/tests/auth-hardening.test.ts +0 -206
- package/packages/aurabase/tests/auth.test.ts +0 -947
- package/packages/aurabase/tests/database.test.ts +0 -230
- package/packages/aurabase/tests/db-types-e2e.test.ts +0 -217
- package/packages/aurabase/tests/dispose.test.ts +0 -23
- package/packages/aurabase/tests/foreign-token.e2e.test.ts +0 -129
- package/packages/aurabase/tests/functions.test.ts +0 -107
- package/packages/aurabase/tests/integration.test.ts +0 -413
- package/packages/aurabase/tests/live-production-validation.js +0 -241
- package/packages/aurabase/tests/live-sdk-production-validation.js +0 -293
- package/packages/aurabase/tests/mocks.ts +0 -139
- package/packages/aurabase/tests/notifications.test.ts +0 -314
- package/packages/aurabase/tests/observability-backup.test.ts +0 -186
- package/packages/aurabase/tests/observability-hook.test.ts +0 -130
- package/packages/aurabase/tests/production-robustness.test.ts +0 -268
- package/packages/aurabase/tests/public-api-surface.test.ts +0 -53
- package/packages/aurabase/tests/query-builder.test.ts +0 -329
- package/packages/aurabase/tests/readme-smoke-e2e.test.ts +0 -231
- package/packages/aurabase/tests/realtime-filter-e2e.test.ts +0 -344
- package/packages/aurabase/tests/refresh-locks.test.ts +0 -210
- package/packages/aurabase/tests/retry-option.test.ts +0 -17
- package/packages/aurabase/tests/rpc-e2e.test.ts +0 -254
- package/packages/aurabase/tests/rs256-local-e2e.test.ts +0 -114
- package/packages/aurabase/tests/rt-alias-public-e2e.test.ts +0 -235
- package/packages/aurabase/tests/rt-http-broadcast-e2e.test.ts +0 -124
- package/packages/aurabase/tests/service-role-guard.test.ts +0 -99
- package/packages/aurabase/tests/ssr.test.ts +0 -91
- package/packages/aurabase/tests/storage-backend-e2e.test.ts +0 -481
- package/packages/aurabase/tests/storage-sdk-parity-e2e.test.ts +0 -104
- package/packages/aurabase/tests/storage-transform-e2e.test.ts +0 -684
- package/packages/aurabase/tests/storage.test.ts +0 -55
- package/packages/aurabase/tests/types/client-generic.test-d.ts +0 -79
- package/packages/aurabase/tests/types/docs-snippets.test-d.ts +0 -571
- package/packages/aurabase/tests/types/error-code.test-d.ts +0 -53
- package/packages/aurabase/tsconfig.json +0 -5
- package/packages/aurabase/tsconfig.test-d.json +0 -5
- package/packages/aurabase/tsup.config.ts +0 -11
- package/packages/aurabase/vitest.config.ts +0 -16
- package/packages/auth/node_modules/.bin/esbuild +0 -19
- package/packages/auth/node_modules/.bin/tsc +0 -22
- package/packages/auth/node_modules/.bin/tsserver +0 -22
- package/packages/auth/node_modules/.bin/tsup +0 -22
- package/packages/auth/node_modules/.bin/tsup-node +0 -22
- package/packages/auth/node_modules/.bin/vite +0 -22
- package/packages/auth/node_modules/.bin/vitest +0 -22
- package/packages/auth/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/auth/src/AuthAdminService.ts +0 -149
- package/packages/auth/src/AuthService.ts +0 -1166
- package/packages/auth/src/SessionManager.ts +0 -92
- package/packages/auth/src/index.ts +0 -17
- package/packages/auth/src/jwks.ts +0 -337
- package/packages/auth/src/pkce.ts +0 -27
- package/packages/auth/src/types.ts +0 -89
- package/packages/auth/tests/auth-lifecycle.test.ts +0 -149
- package/packages/auth/tests/detect-session.test.ts +0 -361
- package/packages/auth/tests/getclaims.test.ts +0 -780
- package/packages/auth/tests/is-mfa-challenge.test.ts +0 -27
- package/packages/auth/tests/password-recovery.test.ts +0 -124
- package/packages/auth/tests/pkce.test.ts +0 -192
- package/packages/auth/tests/session-manager.test.ts +0 -103
- package/packages/auth/tests/set-session.test.ts +0 -139
- package/packages/auth/tests/verify-otp.test.ts +0 -153
- package/packages/auth/tsconfig.json +0 -5
- package/packages/auth/tsup.config.ts +0 -11
- package/packages/core/node_modules/.bin/esbuild +0 -22
- package/packages/core/node_modules/.bin/tsc +0 -22
- package/packages/core/node_modules/.bin/tsserver +0 -22
- package/packages/core/node_modules/.bin/tsup +0 -22
- package/packages/core/node_modules/.bin/tsup-node +0 -22
- package/packages/core/node_modules/.bin/vite +0 -22
- package/packages/core/node_modules/.bin/vitest +0 -22
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/core/src/AuraError.ts +0 -89
- package/packages/core/src/BaseService.ts +0 -44
- package/packages/core/src/client.ts +0 -34
- package/packages/core/src/cookie-utils.ts +0 -42
- package/packages/core/src/fetch.ts +0 -435
- package/packages/core/src/index.ts +0 -22
- package/packages/core/src/retry.ts +0 -63
- package/packages/core/src/serialize.ts +0 -6
- package/packages/core/src/stores/BaseAuthStore.ts +0 -164
- package/packages/core/src/stores/LocalAuthStore.ts +0 -199
- package/packages/core/src/types.ts +0 -1042
- package/packages/core/tests/auth-store.test.ts +0 -300
- package/packages/core/tests/error-code.test.ts +0 -61
- package/packages/core/tests/error.test.ts +0 -24
- package/packages/core/tests/fetch.test.ts +0 -286
- package/packages/core/tests/mocks.ts +0 -139
- package/packages/core/tests/observability.test.ts +0 -86
- package/packages/core/tests/refresh-hardening.test.ts +0 -164
- package/packages/core/tests/refresh-observability.test.ts +0 -111
- package/packages/core/tests/retry.test.ts +0 -106
- package/packages/core/tests/serialize.test.ts +0 -12
- package/packages/core/tests/timeout.test.ts +0 -79
- package/packages/core/tsconfig.json +0 -5
- package/packages/core/tsup.config.ts +0 -11
- package/packages/db/node_modules/.bin/esbuild +0 -19
- package/packages/db/node_modules/.bin/tsc +0 -22
- package/packages/db/node_modules/.bin/tsserver +0 -22
- package/packages/db/node_modules/.bin/tsup +0 -22
- package/packages/db/node_modules/.bin/tsup-node +0 -22
- package/packages/db/node_modules/.bin/vite +0 -22
- package/packages/db/node_modules/.bin/vitest +0 -22
- package/packages/db/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/db/src/DatabaseService.ts +0 -170
- package/packages/db/src/QueryBuilder.ts +0 -830
- package/packages/db/src/index.ts +0 -2
- package/packages/db/src/pgrst-types/common/common.ts +0 -86
- package/packages/db/src/pgrst-types/common/rpc.ts +0 -151
- package/packages/db/src/pgrst-types/feature-flags.ts +0 -20
- package/packages/db/src/pgrst-types/types.ts +0 -134
- package/packages/db/src/select-query-parser/parser.ts +0 -479
- package/packages/db/src/select-query-parser/result.ts +0 -553
- package/packages/db/src/select-query-parser/types.ts +0 -132
- package/packages/db/src/select-query-parser/utils.ts +0 -707
- package/packages/db/tests/filters.test.ts +0 -81
- package/packages/db/tests/mutations-filtered.e2e.test.ts +0 -132
- package/packages/db/tests/mutations-filtered.test.ts +0 -188
- package/packages/db/tests/order.test.ts +0 -45
- package/packages/db/tests/rpc.test.ts +0 -41
- package/packages/db/tests/scale/build-large-schema.ts +0 -94
- package/packages/db/tests/scale/scale-compile.test.ts +0 -167
- package/packages/db/tests/schema.test.ts +0 -77
- package/packages/db/tests/single-accept.e2e.test.ts +0 -123
- package/packages/db/tests/single.test.ts +0 -211
- package/packages/db/tests/types/filters.test-d.ts +0 -52
- package/packages/db/tests/types/fixtures.ts +0 -40
- package/packages/db/tests/types/from-views.test-d.ts +0 -18
- package/packages/db/tests/types/mutations.test-d.ts +0 -23
- package/packages/db/tests/types/rpc.test-d.ts +0 -60
- package/packages/db/tests/types/schema-shape.test-d.ts +0 -8
- package/packages/db/tests/types/select-inference.test-d.ts +0 -38
- package/packages/db/tests/vendored/fixtures.ts +0 -83
- package/packages/db/tests/vendored/get-result.test-d.ts +0 -75
- package/packages/db/tsconfig.json +0 -5
- package/packages/db/tsconfig.test-d.json +0 -5
- package/packages/db/tsup.config.ts +0 -11
- package/packages/db/vitest.config.ts +0 -8
- package/packages/functions/node_modules/.bin/esbuild +0 -19
- package/packages/functions/node_modules/.bin/tsc +0 -22
- package/packages/functions/node_modules/.bin/tsserver +0 -22
- package/packages/functions/node_modules/.bin/tsup +0 -22
- package/packages/functions/node_modules/.bin/tsup-node +0 -22
- package/packages/functions/node_modules/.bin/vite +0 -22
- package/packages/functions/node_modules/.bin/vitest +0 -22
- package/packages/functions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/functions/src/FunctionsService.ts +0 -188
- package/packages/functions/src/errors.ts +0 -70
- package/packages/functions/src/index.ts +0 -6
- package/packages/functions/tests/invoke.test.ts +0 -97
- package/packages/functions/tests/response-type-errors.test.ts +0 -135
- package/packages/functions/tsconfig.json +0 -5
- package/packages/functions/tsup.config.ts +0 -11
- package/packages/gen/node_modules/.bin/esbuild +0 -19
- package/packages/gen/node_modules/.bin/tsc +0 -22
- package/packages/gen/node_modules/.bin/tsserver +0 -22
- package/packages/gen/node_modules/.bin/tsup +0 -22
- package/packages/gen/node_modules/.bin/tsup-node +0 -22
- package/packages/gen/node_modules/.bin/vite +0 -22
- package/packages/gen/node_modules/.bin/vitest +0 -22
- package/packages/gen/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/gen/src/cli.ts +0 -67
- package/packages/gen/src/generate.ts +0 -0
- package/packages/gen/src/index.ts +0 -2
- package/packages/gen/tests/compile.test.ts +0 -213
- package/packages/gen/tests/e2e.test.ts +0 -130
- package/packages/gen/tests/generate.test.ts +0 -396
- package/packages/gen/tsconfig.json +0 -5
- package/packages/gen/tsup.config.ts +0 -11
- package/packages/notifications/node_modules/.bin/esbuild +0 -19
- package/packages/notifications/node_modules/.bin/tsc +0 -22
- package/packages/notifications/node_modules/.bin/tsserver +0 -22
- package/packages/notifications/node_modules/.bin/tsup +0 -22
- package/packages/notifications/node_modules/.bin/tsup-node +0 -22
- package/packages/notifications/node_modules/.bin/vite +0 -22
- package/packages/notifications/node_modules/.bin/vitest +0 -22
- package/packages/notifications/src/NotificationsService.ts +0 -230
- package/packages/notifications/src/index.ts +0 -19
- package/packages/notifications/tsconfig.json +0 -5
- package/packages/notifications/tsup.config.ts +0 -11
- package/packages/realtime/node_modules/.bin/esbuild +0 -19
- package/packages/realtime/node_modules/.bin/tsc +0 -22
- package/packages/realtime/node_modules/.bin/tsserver +0 -22
- package/packages/realtime/node_modules/.bin/tsup +0 -22
- package/packages/realtime/node_modules/.bin/tsup-node +0 -22
- package/packages/realtime/node_modules/.bin/vite +0 -22
- package/packages/realtime/node_modules/.bin/vitest +0 -22
- package/packages/realtime/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/realtime/src/AuraChannel.ts +0 -485
- package/packages/realtime/src/HeartbeatManager.ts +0 -73
- package/packages/realtime/src/RealtimeService.ts +0 -505
- package/packages/realtime/src/columnFilter.ts +0 -301
- package/packages/realtime/src/index.ts +0 -4
- package/packages/realtime/tests/ack-routing.test.ts +0 -81
- package/packages/realtime/tests/column-filter.test.ts +0 -144
- package/packages/realtime/tests/dispatch.test.ts +0 -191
- package/packages/realtime/tests/heartbeat.test.ts +0 -67
- package/packages/realtime/tests/http-broadcast.test.ts +0 -68
- package/packages/realtime/tests/realtime-token.test.ts +0 -43
- package/packages/realtime/tests/reconnect-race.test.ts +0 -149
- package/packages/realtime/tests/ref-id.test.ts +0 -34
- package/packages/realtime/tests/set-auth.test.ts +0 -70
- package/packages/realtime/tsconfig.json +0 -5
- package/packages/realtime/tsup.config.ts +0 -11
- package/packages/storage/node_modules/.bin/esbuild +0 -19
- package/packages/storage/node_modules/.bin/tsc +0 -22
- package/packages/storage/node_modules/.bin/tsserver +0 -22
- package/packages/storage/node_modules/.bin/tsup +0 -22
- package/packages/storage/node_modules/.bin/tsup-node +0 -22
- package/packages/storage/node_modules/.bin/vite +0 -22
- package/packages/storage/node_modules/.bin/vitest +0 -22
- package/packages/storage/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/storage/src/DownloadBuilder.ts +0 -60
- package/packages/storage/src/StorageService.ts +0 -323
- package/packages/storage/src/index.ts +0 -2
- package/packages/storage/src/path.ts +0 -35
- package/packages/storage/src/transform.ts +0 -15
- package/packages/storage/tests/download.test.ts +0 -64
- package/packages/storage/tests/parity.test.ts +0 -154
- package/packages/storage/tests/path.test.ts +0 -87
- package/packages/storage/tests/transform.test.ts +0 -79
- package/packages/storage/tsconfig.json +0 -5
- package/packages/storage/tsup.config.ts +0 -11
- package/pnpm-workspace.yaml +0 -24
- package/tsconfig.base.json +0 -15
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { BaseService } from '@aurabase/core'
|
|
2
|
-
import type {
|
|
3
|
-
AuraResponse,
|
|
4
|
-
BatchSendResponse,
|
|
5
|
-
Notification,
|
|
6
|
-
NotificationAttempt,
|
|
7
|
-
NotificationDeadLetter,
|
|
8
|
-
NotificationEvent,
|
|
9
|
-
NotificationProviderLog,
|
|
10
|
-
NotificationQueueStats,
|
|
11
|
-
NotificationRule,
|
|
12
|
-
NotificationSettings,
|
|
13
|
-
NotificationStats,
|
|
14
|
-
NotificationTemplate,
|
|
15
|
-
NotificationTemplatePreview,
|
|
16
|
-
SendNotificationRequest,
|
|
17
|
-
} from '@aurabase/core'
|
|
18
|
-
import type { AuraClientLike } from '@aurabase/core'
|
|
19
|
-
|
|
20
|
-
type NotificationChannel = 'email' | 'sms' | 'push' | 'webhook'
|
|
21
|
-
type NotificationStatus = 'queued' | 'processing' | 'sent' | 'failed' | 'delivered' | 'expired' | 'dead_lettered'
|
|
22
|
-
type CreateNotificationRuleRequest = {
|
|
23
|
-
name: string
|
|
24
|
-
trigger_type: string
|
|
25
|
-
condition?: Record<string, unknown>
|
|
26
|
-
template_id?: string | null
|
|
27
|
-
channel: NotificationChannel
|
|
28
|
-
recipient_expr: string
|
|
29
|
-
delay_seconds?: number
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export class NotificationsService extends BaseService {
|
|
33
|
-
readonly admin: NotificationsAdminService
|
|
34
|
-
|
|
35
|
-
constructor(client: AuraClientLike) {
|
|
36
|
-
super(client)
|
|
37
|
-
this.admin = new NotificationsAdminService(client)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private get prefix(): string {
|
|
41
|
-
return `/v1/notifications/${this.client.projectId}`
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// -- Send -------------------------------------------------------------------
|
|
45
|
-
|
|
46
|
-
async send(
|
|
47
|
-
channel: NotificationChannel,
|
|
48
|
-
recipient: string,
|
|
49
|
-
body: string,
|
|
50
|
-
options?: {
|
|
51
|
-
subject?: string
|
|
52
|
-
templateId?: string
|
|
53
|
-
variables?: Record<string, unknown>
|
|
54
|
-
metadata?: Record<string, unknown>
|
|
55
|
-
idempotencyKey?: string
|
|
56
|
-
},
|
|
57
|
-
): Promise<AuraResponse<Notification>> {
|
|
58
|
-
return this.request('POST', `${this.prefix}/send`, {
|
|
59
|
-
channel,
|
|
60
|
-
recipient,
|
|
61
|
-
body,
|
|
62
|
-
subject: options?.subject,
|
|
63
|
-
template_id: options?.templateId,
|
|
64
|
-
variables: options?.variables,
|
|
65
|
-
metadata: options?.metadata,
|
|
66
|
-
idempotency_key: options?.idempotencyKey,
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async sendBatch(items: SendNotificationRequest[]): Promise<AuraResponse<BatchSendResponse>> {
|
|
71
|
-
return this.request('POST', `${this.prefix}/send/batch`, { items })
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// -- Notification history ---------------------------------------------------
|
|
75
|
-
|
|
76
|
-
async list(options?: {
|
|
77
|
-
channel?: NotificationChannel
|
|
78
|
-
status?: NotificationStatus
|
|
79
|
-
search?: string
|
|
80
|
-
sort?: 'created_at' | 'updated_at' | 'status'
|
|
81
|
-
order?: 'asc' | 'desc'
|
|
82
|
-
limit?: number
|
|
83
|
-
offset?: number
|
|
84
|
-
}): Promise<AuraResponse<Notification[]>> {
|
|
85
|
-
const params = new URLSearchParams()
|
|
86
|
-
if (options?.channel !== undefined) params.set('channel', options.channel)
|
|
87
|
-
if (options?.status !== undefined) params.set('status', options.status)
|
|
88
|
-
if (options?.search !== undefined) params.set('search', options.search)
|
|
89
|
-
if (options?.sort !== undefined) params.set('sort', options.sort)
|
|
90
|
-
if (options?.order !== undefined) params.set('order', options.order)
|
|
91
|
-
if (options?.limit !== undefined) params.set('limit', String(options.limit))
|
|
92
|
-
if (options?.offset !== undefined) params.set('offset', String(options.offset))
|
|
93
|
-
const qs = params.toString()
|
|
94
|
-
const sep = qs ? '?' : ''
|
|
95
|
-
return this.request('GET', `${this.prefix}${sep}${qs}`)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
async get(id: string): Promise<AuraResponse<Notification>> {
|
|
99
|
-
return this.request('GET', `${this.prefix}/${id}`)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// -- Templates --------------------------------------------------------------
|
|
103
|
-
|
|
104
|
-
async listTemplates(): Promise<AuraResponse<NotificationTemplate[]>> {
|
|
105
|
-
return this.request('GET', `${this.prefix}/templates`)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async getTemplate(id: string): Promise<AuraResponse<NotificationTemplate>> {
|
|
109
|
-
return this.request('GET', `${this.prefix}/templates/${id}`)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async createTemplate(
|
|
113
|
-
template: Omit<NotificationTemplate, 'id' | 'created_at' | 'updated_at'>,
|
|
114
|
-
): Promise<AuraResponse<NotificationTemplate>> {
|
|
115
|
-
return this.request('POST', `${this.prefix}/templates`, template)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async updateTemplate(
|
|
119
|
-
id: string,
|
|
120
|
-
updates: Partial<Omit<NotificationTemplate, 'id' | 'created_at' | 'updated_at'>>,
|
|
121
|
-
): Promise<AuraResponse<NotificationTemplate>> {
|
|
122
|
-
return this.request('PATCH', `${this.prefix}/templates/${id}`, updates)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async deleteTemplate(id: string): Promise<AuraResponse<null>> {
|
|
126
|
-
return this.request('DELETE', `${this.prefix}/templates/${id}`)
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export class NotificationsAdminService extends BaseService {
|
|
131
|
-
constructor(client: AuraClientLike) {
|
|
132
|
-
super(client)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
private get prefix(): string {
|
|
136
|
-
return `/v1/notifications/${this.client.projectId}`
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private query(options?: Record<string, string | number | boolean | null | undefined>): string {
|
|
140
|
-
const params = new URLSearchParams()
|
|
141
|
-
for (const [key, value] of Object.entries(options ?? {})) {
|
|
142
|
-
if (value !== undefined && value !== null && value !== '') params.set(key, String(value))
|
|
143
|
-
}
|
|
144
|
-
const qs = params.toString()
|
|
145
|
-
return qs ? `?${qs}` : ''
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async getSettings(): Promise<AuraResponse<NotificationSettings>> {
|
|
149
|
-
return this.request('GET', `${this.prefix}/settings`)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
async updateSettings(settings: Partial<NotificationSettings>): Promise<AuraResponse<NotificationSettings>> {
|
|
153
|
-
return this.request('PATCH', `${this.prefix}/settings`, settings)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
async getStats(options?: {
|
|
157
|
-
window?: string
|
|
158
|
-
channel?: NotificationChannel
|
|
159
|
-
}): Promise<AuraResponse<NotificationStats>> {
|
|
160
|
-
return this.request('GET', `${this.prefix}/stats${this.query(options)}`)
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async getQueue(): Promise<AuraResponse<NotificationQueueStats>> {
|
|
164
|
-
return this.request('GET', `${this.prefix}/queue`)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async listAttempts(notificationId: string): Promise<AuraResponse<NotificationAttempt[]>> {
|
|
168
|
-
return this.request('GET', `${this.prefix}/${notificationId}/attempts`)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
async listDeadLetters(options?: {
|
|
172
|
-
channel?: NotificationChannel
|
|
173
|
-
search?: string
|
|
174
|
-
limit?: number
|
|
175
|
-
offset?: number
|
|
176
|
-
}): Promise<AuraResponse<NotificationDeadLetter[]>> {
|
|
177
|
-
return this.request('GET', `${this.prefix}/dead-letters${this.query(options)}`)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
async retryDeadLetter(id: string): Promise<AuraResponse<Notification>> {
|
|
181
|
-
return this.request('POST', `${this.prefix}/dead-letters/${id}/retry`)
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
async listEvents(options?: {
|
|
185
|
-
status?: 'received' | 'matched' | 'ignored' | 'failed' | 'enqueued'
|
|
186
|
-
limit?: number
|
|
187
|
-
offset?: number
|
|
188
|
-
}): Promise<AuraResponse<NotificationEvent[]>> {
|
|
189
|
-
return this.request('GET', `${this.prefix}/events${this.query(options)}`)
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
async listProviderLogs(options?: {
|
|
193
|
-
channel?: NotificationChannel
|
|
194
|
-
status?: string
|
|
195
|
-
limit?: number
|
|
196
|
-
offset?: number
|
|
197
|
-
}): Promise<AuraResponse<NotificationProviderLog[]>> {
|
|
198
|
-
return this.request('GET', `${this.prefix}/providers/logs${this.query(options)}`)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
async previewTemplate(
|
|
202
|
-
id: string,
|
|
203
|
-
variables: Record<string, unknown>,
|
|
204
|
-
): Promise<AuraResponse<NotificationTemplatePreview>> {
|
|
205
|
-
return this.request('POST', `${this.prefix}/templates/${id}/preview`, variables)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
async listRules(): Promise<AuraResponse<NotificationRule[]>> {
|
|
209
|
-
return this.request('GET', `${this.prefix}/rules`)
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
async createRule(rule: CreateNotificationRuleRequest): Promise<AuraResponse<NotificationRule>> {
|
|
213
|
-
return this.request('POST', `${this.prefix}/rules`, rule)
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
async getRule(id: string): Promise<AuraResponse<NotificationRule>> {
|
|
217
|
-
return this.request('GET', `${this.prefix}/rules/${id}`)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
async updateRule(
|
|
221
|
-
id: string,
|
|
222
|
-
updates: Partial<Omit<NotificationRule, 'id' | 'project_id' | 'created_at' | 'updated_at'>>,
|
|
223
|
-
): Promise<AuraResponse<NotificationRule>> {
|
|
224
|
-
return this.request('PATCH', `${this.prefix}/rules/${id}`, updates)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
async deleteRule(id: string): Promise<AuraResponse<null>> {
|
|
228
|
-
return this.request('DELETE', `${this.prefix}/rules/${id}`)
|
|
229
|
-
}
|
|
230
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { NotificationsService, NotificationsAdminService } from './NotificationsService'
|
|
2
|
-
|
|
3
|
-
// Types publics (utilisables en consommant `@aurabase/notifications` seul).
|
|
4
|
-
export type {
|
|
5
|
-
AuraResponse,
|
|
6
|
-
Notification,
|
|
7
|
-
NotificationTemplate,
|
|
8
|
-
SendNotificationRequest,
|
|
9
|
-
BatchSendResponse,
|
|
10
|
-
NotificationAttempt,
|
|
11
|
-
NotificationDeadLetter,
|
|
12
|
-
NotificationEvent,
|
|
13
|
-
NotificationProviderLog,
|
|
14
|
-
NotificationQueueStats,
|
|
15
|
-
NotificationRule,
|
|
16
|
-
NotificationSettings,
|
|
17
|
-
NotificationStats,
|
|
18
|
-
NotificationTemplatePreview,
|
|
19
|
-
} from '@aurabase/core'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
"$basedir/../../../../node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild" "$@"
|
|
18
|
-
exit $?
|
|
19
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/realtime/node_modules/typescript/bin/tsc
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/realtime/node_modules/typescript/bin/tsserver
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../tsup/dist/cli-default.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../tsup/dist/cli-default.js" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/realtime/node_modules/tsup/dist/cli-default.js
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../tsup/dist/cli-node.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../tsup/dist/cli-node.js" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/realtime/node_modules/tsup/dist/cli-node.js
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules/vitest/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules/vitest/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
-
fi
|
|
22
|
-
# cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/realtime/node_modules/vitest/vitest.mjs
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"4.1.9","results":[[":tests/ref-id.test.ts",{"duration":276.45404099999996,"failed":false}],[":tests/heartbeat.test.ts",{"duration":215.94383300000027,"failed":false}],[":tests/realtime-token.test.ts",{"duration":21.736917000000176,"failed":false}],[":tests/dispatch.test.ts",{"duration":45.81758400000035,"failed":false}],[":tests/reconnect-race.test.ts",{"duration":198.24125000000004,"failed":false}],[":tests/column-filter.test.ts",{"duration":294.01454100000046,"failed":false}],[":tests/http-broadcast.test.ts",{"duration":679.043208,"failed":false}],[":tests/ack-routing.test.ts",{"duration":31.36370799999986,"failed":false}],[":tests/set-auth.test.ts",{"duration":42.39454100000012,"failed":false}]]}
|