@managemint-solutions/sdk 0.23.0 → 0.24.0

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 (97) hide show
  1. package/README.md +57 -21
  2. package/dist/additional-details/dto.js +0 -1
  3. package/dist/additional-details/index.js +0 -1
  4. package/dist/additional-details/values.js +0 -1
  5. package/dist/audit/dto.js +0 -1
  6. package/dist/audit/index.js +0 -1
  7. package/dist/auth-client/dto.js +0 -1
  8. package/dist/auth-client/index.d.ts +7 -0
  9. package/dist/auth-client/index.js +11 -1
  10. package/dist/auth.js +0 -1
  11. package/dist/billing/dto.js +0 -1
  12. package/dist/billing/index.js +0 -1
  13. package/dist/billing/invoices/dto.d.ts +2 -2
  14. package/dist/billing/invoices/dto.js +0 -1
  15. package/dist/billing/invoices/index.js +0 -1
  16. package/dist/client.js +0 -1
  17. package/dist/clients/dto.js +0 -1
  18. package/dist/clients/index.js +0 -1
  19. package/dist/errors.js +11 -6
  20. package/dist/index.d.ts +3 -20
  21. package/dist/index.js +50 -85
  22. package/dist/nest/index.d.ts +5 -0
  23. package/dist/nest/index.js +5 -1
  24. package/dist/notes/dto.js +0 -1
  25. package/dist/notes/index.js +0 -1
  26. package/dist/notifications/dto.js +0 -1
  27. package/dist/notifications/index.js +0 -1
  28. package/dist/organization-invites/index.js +0 -1
  29. package/dist/organization-payment-methods/index.js +0 -1
  30. package/dist/organizations/dto.js +0 -1
  31. package/dist/organizations/index.js +0 -1
  32. package/dist/permissions/dto.js +0 -1
  33. package/dist/permissions/index.js +0 -1
  34. package/dist/pricebooks/index.js +0 -1
  35. package/dist/projects/dto.js +0 -1
  36. package/dist/projects/index.js +0 -1
  37. package/dist/service-client/index.d.ts +5 -0
  38. package/dist/service-client/index.js +13 -1
  39. package/dist/statuses/dto.js +0 -1
  40. package/dist/statuses/index.js +0 -1
  41. package/dist/supporting-files/dto.js +0 -1
  42. package/dist/supporting-files/index.js +0 -1
  43. package/dist/supporting-files/paths.js +0 -1
  44. package/dist/tasks/dto.js +0 -1
  45. package/dist/tasks/index.js +0 -1
  46. package/dist/transforms.js +0 -1
  47. package/dist/users/dto.js +0 -1
  48. package/dist/users/index.js +0 -1
  49. package/dist/users/paths.js +0 -1
  50. package/dist/validators.js +0 -1
  51. package/dist/webhook-events/index.js +0 -1
  52. package/package.json +1 -1
  53. package/dist/additional-details/dto.js.map +0 -1
  54. package/dist/additional-details/index.js.map +0 -1
  55. package/dist/additional-details/values.js.map +0 -1
  56. package/dist/audit/dto.js.map +0 -1
  57. package/dist/audit/index.js.map +0 -1
  58. package/dist/auth-client/dto.js.map +0 -1
  59. package/dist/auth-client/index.js.map +0 -1
  60. package/dist/auth.js.map +0 -1
  61. package/dist/billing/dto.js.map +0 -1
  62. package/dist/billing/index.js.map +0 -1
  63. package/dist/billing/invoices/dto.js.map +0 -1
  64. package/dist/billing/invoices/index.js.map +0 -1
  65. package/dist/client.js.map +0 -1
  66. package/dist/clients/dto.js.map +0 -1
  67. package/dist/clients/index.js.map +0 -1
  68. package/dist/errors.js.map +0 -1
  69. package/dist/index.js.map +0 -1
  70. package/dist/nest/index.js.map +0 -1
  71. package/dist/notes/dto.js.map +0 -1
  72. package/dist/notes/index.js.map +0 -1
  73. package/dist/notifications/dto.js.map +0 -1
  74. package/dist/notifications/index.js.map +0 -1
  75. package/dist/organization-invites/index.js.map +0 -1
  76. package/dist/organization-payment-methods/index.js.map +0 -1
  77. package/dist/organizations/dto.js.map +0 -1
  78. package/dist/organizations/index.js.map +0 -1
  79. package/dist/permissions/dto.js.map +0 -1
  80. package/dist/permissions/index.js.map +0 -1
  81. package/dist/pricebooks/index.js.map +0 -1
  82. package/dist/projects/dto.js.map +0 -1
  83. package/dist/projects/index.js.map +0 -1
  84. package/dist/service-client/index.js.map +0 -1
  85. package/dist/statuses/dto.js.map +0 -1
  86. package/dist/statuses/index.js.map +0 -1
  87. package/dist/supporting-files/dto.js.map +0 -1
  88. package/dist/supporting-files/index.js.map +0 -1
  89. package/dist/supporting-files/paths.js.map +0 -1
  90. package/dist/tasks/dto.js.map +0 -1
  91. package/dist/tasks/index.js.map +0 -1
  92. package/dist/transforms.js.map +0 -1
  93. package/dist/users/dto.js.map +0 -1
  94. package/dist/users/index.js.map +0 -1
  95. package/dist/users/paths.js.map +0 -1
  96. package/dist/validators.js.map +0 -1
  97. package/dist/webhook-events/index.js.map +0 -1
package/README.md CHANGED
@@ -241,32 +241,35 @@ import { configureSupabaseUserClient } from '@managemint-solutions/sdk/nest';
241
241
  configureSupabaseUserClient({ onAuditError: (error) => Sentry.captureException(error) });
242
242
  ```
243
243
 
244
- Consumers writing tables the SDK has no resource for (the api's admin-client modules) use the same
245
- helper over their own client, so they carry no audit code either:
244
+ Service-role work with no caller (webhooks, the queue worker, provisioning) goes through the
245
+ service client's organization scope, which supplies the audit actor — `mms_id: null` for system
246
+ work — and hands out audited tables for anything the SDK has no resource for:
246
247
 
247
248
  ```ts
248
- import { AuditResource, auditedTable } from '@managemint-solutions/sdk';
249
+ import { createSupabaseServiceClient } from '@managemint-solutions/sdk';
249
250
  import { AuditTrailAction, AuditTrailEntityType } from '@managemint-solutions/entities/audit-trail/enum';
250
251
 
251
- const actor = { mms_id: authUser.mms_id, organization_id: authUser.organization_id }; // mms_id: null for system jobs
252
- const audit = new AuditResource(adminClient, actor, onAuditError);
253
- const users = auditedTable(adminClient, actor, audit, {
254
- table: 'users',
255
- entityType: AuditTrailEntityType.USER,
256
- });
252
+ const service = createSupabaseServiceClient({ url, serviceRoleKey, onAuditError });
253
+ const scope = service.forOrganization(organizationId, actorMmsId); // actorMmsId: null for system jobs
254
+
255
+ await scope.paymentMethod.set({ paystack_customer_code: 'CUS_x' }); // service-role-only resource
256
+ const users = scope.table({ table: 'users', entityType: AuditTrailEntityType.USER });
257
257
 
258
- const row = await users.insert({ ...payload, organization_id: actor.organization_id });
258
+ const row = await users.insert({ ...payload, organization_id: organizationId });
259
259
  await users.update(userId, { name: 'Ada' }); // records UPDATE
260
260
  await users.update(userId, (before) => ({ active: !before.active })); // payload from the pre-read
261
261
  await users.transition(userId, AuditTrailAction.DELETE, { deleted: true }); // records the given action
262
262
  const deleted = await users.remove(userId); // hard delete; returns the old row
263
263
  ```
264
264
 
265
+ Cross-tenant lookups — the organization behind a Paystack code, a ledger row by id, every
266
+ organization with a Paystack customer — hang off `service` itself, because a webhook or cron does
267
+ not know its tenant until it looks one up.
268
+
265
269
  `update` / `transition` / `remove` pre-read the flat row (by `mms_id`, and by `organization_id`
266
270
  unless `scopeByOrganization: false` — the `organizations` table is its own tenant), so a missing
267
271
  row surfaces as the usual 406. The write itself still throws `SupabaseClientError` on failure;
268
- only the audit insert is swallowed. `diffChanges(before, after)` and
269
- `snapshotChanges(row, 'new' | 'old')` are exported as pure functions if you need them directly.
272
+ only the audit insert is swallowed.
270
273
 
271
274
  Only what goes through the SDK/API is logged — a raw PostgREST write or a dashboard edit is not.
272
275
 
@@ -286,7 +289,7 @@ const auth = createSupabaseAuthClient({
286
289
 
287
290
  const { access_token, refresh_token } = await auth.signIn({ email, password });
288
291
  await auth.refreshSession({ refresh_token });
289
- await auth.signOut();
292
+ await auth.signOut(access_token); // revokes that session's refresh token on the server
290
293
 
291
294
  // The redirect URL is passed in; the SDK reads no environment variables.
292
295
  await auth.sendPasswordResetEmail({ email }, `${process.env.FRONTEND_URL}/reset-password`);
@@ -296,9 +299,12 @@ await auth.resetPassword({ password, access_token, refresh_token });
296
299
  ```
297
300
 
298
301
  `signIn` also stamps `users.last_logged_in` for the user who just signed in, on a throwaway
299
- client carrying the fresh access token; a failed stamp never fails the login. `signOut` is a
300
- no-op server-side the client holds no session and is kept for parity with the api endpoint
301
- it replaces. `auth.supabase` is the raw `@supabase/supabase-js` client.
302
+ client carrying the fresh access token; a failed stamp never fails the login. `signOut` takes the
303
+ caller's access token because this client holds no session of its own: GoTrue's logout endpoint
304
+ authenticates with the token itself, and the `local` scope ends that device's session only. Build
305
+ one of these per request — supabase-js keeps the session `signIn`, `verifyOtp` and `setSession`
306
+ produce in the client's memory, so a shared instance would leak sessions between callers.
307
+ `auth.supabase` is the raw `@supabase/supabase-js` client.
302
308
 
303
309
  ```ts
304
310
  import { SupabasePublicClient } from '@managemint-solutions/sdk/nest';
@@ -313,6 +319,33 @@ export class AuthController {
313
319
  }
314
320
  ```
315
321
 
322
+ ## Billing and invoices
323
+
324
+ Billing is split by who may write. On the caller's client, `supabase.billing` and
325
+ `supabase.invoices` are **read** resources over the ledger and the invoices table, scoped by RLS
326
+ to the caller's organization; every write to the ledger is service-role only and lives on the
327
+ service client's organization scope (`scope.billing`, `scope.invoices`, `scope.paymentMethod`).
328
+
329
+ ```ts
330
+ import type { InvoiceEntity, InvoiceSummary } from '@managemint-solutions/entities/billing/invoices';
331
+ import type { MmsList } from '@managemint-solutions/entities/common';
332
+
333
+ // Paginated, newest first; `status_in` is a CSV of BillingTransactionStatus values.
334
+ const page: MmsList<InvoiceSummary> = await supabase.invoices.list({ page: 1, page_size: 25 });
335
+ const invoice: InvoiceEntity | null = await supabase.invoices.byId(invoiceId); // null when not ours
336
+
337
+ // Service side, when a ledger row is written:
338
+ const next = (await scope.invoices.maxNumber()) + 1; // per-organization sequence
339
+ await scope.invoices.create(row); // unique (organization_id, invoice_number)
340
+ await scope.invoices.syncStatus(transactionId, { status, paid_at });
341
+ const references = await scope.billing.paystackReferences(); // what the reconcile diffs against
342
+ ```
343
+
344
+ Invoice numbers are assigned by the writer as `max + 1` and arbitrated by the unique index: a
345
+ `23505` on insert means a concurrent writer took the number, and the caller retries once with
346
+ the next one. The document itself (HTML/PDF) is rendered by the api from the row; the SDK stores
347
+ and reads rows only.
348
+
316
349
  ## Pricebooks
317
350
 
318
351
  The price catalog (`pricebooks`, `pricebook_modules`, `billing_modules`) is readable by `anon`
@@ -338,11 +371,14 @@ row joined with its `billing_modules` catalog entry). Exactly one pricebook is a
338
371
 
339
372
  Every error the SDK throws is a `SupabaseClientError` carrying the HTTP `status` to respond
340
373
  with and the client-facing body, `toResponse()` → `{ error, message }`. Postgrest/Postgres
341
- errors are translated by `mapPostgrestError` (Postgrest code status, RLS permission and
342
- module denials readable messages), Storage errors by `mapStorageError` (the storage error's
343
- own HTTP status, or 500 when it has none), Supabase Auth errors by `mapAuthError` (same rule,
344
- `Authentication Error`); JWT problems are `401 Authentication Error`. Consumers
345
- return these as-is instead of mapping database errors themselves.
374
+ errors are mapped by code: `PGRST*` codes to their documented statuses, an RLS or grant denial
375
+ (`42501`) to **403**, a unique or foreign-key violation (`23505`, `23503`) to **409**, a not-null,
376
+ check or malformed-literal failure (`23502`, `23514`, `22P02`) to **400**, anything else 500
377
+ the message is always Postgrest's own. Storage errors carry the storage error's own HTTP status
378
+ (500 when it has none); Supabase Auth errors likewise, as `Authentication Error`; a rejected or
379
+ missing JWT is `401 Authentication Error`. Consumers return these as-is instead of mapping
380
+ database errors themselves, and `error.code` keeps the raw Postgres code for the few callers
381
+ that branch on one (the invoice-number retry on `23505`).
346
382
 
347
383
  ## NestJS
348
384
 
@@ -141,4 +141,3 @@ __decorate([
141
141
  (0, class_validator_1.IsBoolean)({ message: 'Invalid copyable value' }),
142
142
  __metadata("design:type", Boolean)
143
143
  ], UpdateAdditionalDetailsDto.prototype, "copyable", void 0);
144
- //# sourceMappingURL=dto.js.map
@@ -96,4 +96,3 @@ class AdditionalDetailsResource {
96
96
  }
97
97
  }
98
98
  exports.AdditionalDetailsResource = AdditionalDetailsResource;
99
- //# sourceMappingURL=index.js.map
@@ -34,4 +34,3 @@ exports.castValueByType = castValueByType;
34
34
  */
35
35
  const serializeValue = (value) => value instanceof Date ? value.toISOString() : String(value);
36
36
  exports.serializeValue = serializeValue;
37
- //# sourceMappingURL=values.js.map
package/dist/audit/dto.js CHANGED
@@ -94,4 +94,3 @@ __decorate([
94
94
  (0, class_validator_1.IsUUID)(['4', '7'], { message: 'Entity ID must be a valid UUID' }),
95
95
  __metadata("design:type", Object)
96
96
  ], GetAuditTrailDto.prototype, "entity_id", void 0);
97
- //# sourceMappingURL=dto.js.map
@@ -340,4 +340,3 @@ const auditedTable = (supabase, actor, audit, options) => {
340
340
  };
341
341
  };
342
342
  exports.auditedTable = auditedTable;
343
- //# sourceMappingURL=index.js.map
@@ -69,4 +69,3 @@ __decorate([
69
69
  (0, class_validator_1.IsString)({ message: 'Refresh token is required' }),
70
70
  __metadata("design:type", String)
71
71
  ], ResetPasswordDto.prototype, "refresh_token", void 0);
72
- //# sourceMappingURL=dto.js.map
@@ -20,6 +20,13 @@ export declare class SupabaseAuthClient {
20
20
  constructor(config: SupabaseAuthClientConfig);
21
21
  signIn(input: loginDto): Promise<LoginResponse>;
22
22
  refreshSession(input: ExchangeRefreshTokenDto): Promise<ExchangeTokenResponse>;
23
+ /**
24
+ * Revokes the session behind `accessToken`, so its refresh token stops working at once.
25
+ * GoTrue's logout endpoint authenticates with the token itself, which is why this session-less
26
+ * publishable-key client is enough; `local` ends this device's session and leaves the user's
27
+ * other sessions alone.
28
+ */
29
+ signOut(accessToken: string): Promise<void>;
23
30
  /** `redirectTo` is passed in — the SDK reads no environment variables. */
24
31
  sendPasswordResetEmail(input: SendPasswordResetEmailDto, redirectTo: string): Promise<void>;
25
32
  exchangeRecoveryToken(input: ExchangeTokenHashDto): Promise<ExchangeTokenResponse>;
@@ -63,6 +63,17 @@ class SupabaseAuthClient {
63
63
  throw noSession('Token exchange failed: No session data returned');
64
64
  return toTokens(data.session);
65
65
  }
66
+ /**
67
+ * Revokes the session behind `accessToken`, so its refresh token stops working at once.
68
+ * GoTrue's logout endpoint authenticates with the token itself, which is why this session-less
69
+ * publishable-key client is enough; `local` ends this device's session and leaves the user's
70
+ * other sessions alone.
71
+ */
72
+ async signOut(accessToken) {
73
+ const { error } = await this.supabase.auth.admin.signOut(accessToken, 'local');
74
+ if (error)
75
+ throw (0, errors_1.mapAuthError)(error);
76
+ }
66
77
  /** `redirectTo` is passed in — the SDK reads no environment variables. */
67
78
  async sendPasswordResetEmail(input, redirectTo) {
68
79
  const { error } = await this.supabase.auth.resetPasswordForEmail(input.email, { redirectTo });
@@ -121,4 +132,3 @@ class SupabaseAuthClient {
121
132
  exports.SupabaseAuthClient = SupabaseAuthClient;
122
133
  const createSupabaseAuthClient = (config) => new SupabaseAuthClient(config);
123
134
  exports.createSupabaseAuthClient = createSupabaseAuthClient;
124
- //# sourceMappingURL=index.js.map
package/dist/auth.js CHANGED
@@ -73,4 +73,3 @@ const verifyAccessToken = async ({ url, key, accessToken, client = (0, exports.c
73
73
  };
74
74
  };
75
75
  exports.verifyAccessToken = verifyAccessToken;
76
- //# sourceMappingURL=auth.js.map
@@ -72,4 +72,3 @@ __decorate([
72
72
  (0, class_validator_1.IsUUID)('4', { message: 'An idempotency key is required and must be a v4 uuid' }),
73
73
  __metadata("design:type", String)
74
74
  ], PurchaseModuleDto.prototype, "idempotency_key", void 0);
75
- //# sourceMappingURL=dto.js.map
@@ -126,4 +126,3 @@ class BillingResource extends BillingReadsResource {
126
126
  }
127
127
  }
128
128
  exports.BillingResource = BillingResource;
129
- //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import type { GetInvoicesDto as GetInvoicesDtoType } from '@managemint-solutions/entities/billing/invoices/dto';
1
+ import type { GetInvoicesDto as GetInvoicesDtoType, InvoiceIdDto as InvoiceIdDtoType } from '@managemint-solutions/entities/billing/invoices/dto';
2
2
  import { BillingTransactionStatus } from '@managemint-solutions/entities/billing/enum';
3
3
  /** GET /billing/invoices/:invoiceId. v7: `invoices.mms_id` defaults from `uuidv7()`. */
4
- export declare class InvoiceIdDto {
4
+ export declare class InvoiceIdDto implements InvoiceIdDtoType {
5
5
  readonly invoiceId: string;
6
6
  }
7
7
  export declare class GetInvoicesQueryDto implements Omit<GetInvoicesDtoType, 'status_in'> {
@@ -54,4 +54,3 @@ __decorate([
54
54
  (0, class_validator_1.IsEnum)(enum_1.BillingTransactionStatus, { each: true, message: 'Invalid invoice status filter' }),
55
55
  __metadata("design:type", Object)
56
56
  ], GetInvoicesQueryDto.prototype, "status_in", void 0);
57
- //# sourceMappingURL=dto.js.map
@@ -129,4 +129,3 @@ class InvoicesResource extends InvoicesReadsResource {
129
129
  }
130
130
  }
131
131
  exports.InvoicesResource = InvoicesResource;
132
- //# sourceMappingURL=index.js.map
package/dist/client.js CHANGED
@@ -62,4 +62,3 @@ class SupabaseClient {
62
62
  exports.SupabaseClient = SupabaseClient;
63
63
  const createSupabaseClient = (config) => new SupabaseClient(config);
64
64
  exports.createSupabaseClient = createSupabaseClient;
65
- //# sourceMappingURL=client.js.map
@@ -178,4 +178,3 @@ __decorate([
178
178
  (0, class_validator_1.Min)(0, { message: 'Contracted hours must be at least 0' }),
179
179
  __metadata("design:type", Object)
180
180
  ], UpdateClientDto.prototype, "contracted_hours", void 0);
181
- //# sourceMappingURL=dto.js.map
@@ -164,4 +164,3 @@ class ClientsResource {
164
164
  }
165
165
  }
166
166
  exports.ClientsResource = ClientsResource;
167
- //# sourceMappingURL=index.js.map
package/dist/errors.js CHANGED
@@ -61,11 +61,17 @@ const POSTGREST_CODE_TO_HTTP_STATUS = {
61
61
  PGRST302: 401,
62
62
  // Group X - Internal
63
63
  PGRSTX00: 500,
64
- // Not PGRST* codes: an RLS denial, and the bare HTTP statuses PostgREST reports for some
65
- // failures.
66
- 42501: 401,
67
- 404: 404,
68
- 400: 400,
64
+ // Postgres codes PostgREST passes through. An RLS or grant denial is a 403: the caller is
65
+ // authenticated, just not allowed - a 401 here sent the portal into a refresh-and-retry loop.
66
+ 42501: 403,
67
+ // Integrity violations: the unique-index and foreign-key races are conflicts the caller (or
68
+ // a retry) can resolve; a not-null or check failure is a bad request.
69
+ 23505: 409,
70
+ 23503: 409,
71
+ 23502: 400,
72
+ 23514: 400,
73
+ // Malformed literal, e.g. a non-uuid where a uuid column is filtered.
74
+ '22P02': 400,
69
75
  };
70
76
  /**
71
77
  * Converts a raw Postgrest error into the SupabaseClientError the SDK throws. The message is
@@ -100,4 +106,3 @@ const mapAuthError = (error) => new SupabaseClientError({
100
106
  message: error.message,
101
107
  }, { cause: error });
102
108
  exports.mapAuthError = mapAuthError;
103
- //# sourceMappingURL=errors.js.map
package/dist/index.d.ts CHANGED
@@ -1,52 +1,35 @@
1
1
  export { SupabaseClient, createSupabaseClient } from './client';
2
2
  export type { SupabaseClientConfig, TypedSupabaseClient } from './client';
3
- export { verifyAccessToken } from './auth';
4
3
  export type { AuthContext, VerifiedAuth, VerifiedOrganization, VerifyAccessTokenConfig, } from './auth';
5
4
  export { SupabaseAuthClient, createSupabaseAuthClient } from './auth-client';
6
5
  export type { SupabaseAuthClientConfig } from './auth-client';
7
6
  export { ExchangeRefreshTokenDto, ExchangeTokenHashDto, ResetPasswordDto, SendPasswordResetEmailDto, SignInDto, } from './auth-client';
8
- export { SupabaseServiceClient, SupabaseOrganizationScope, createSupabaseServiceClient, } from './service-client';
9
- export type { SupabaseServiceClientConfig } from './service-client';
7
+ export { SupabaseServiceClient, createSupabaseServiceClient } from './service-client';
8
+ export type { SupabaseOrganizationScope, SupabaseServiceClientConfig } from './service-client';
10
9
  export { SupabaseClientError } from './errors';
11
10
  export type { SupabaseClientErrorInit } from './errors';
12
11
  export { IsNullable } from './validators';
13
- export { AuditResource } from './audit';
14
12
  export type { AuditActor, AuditChanges, AuditEntry, AuditErrorHandler, AuditGuard, AuditRow, AuditedTable, AuditedTableOptions, } from './audit';
15
13
  export { GetAuditTrailDto } from './audit';
16
- export { BillingReadsResource, BillingResource } from './billing';
17
14
  export { CancelSubscriptionDto, InitialPaymentDto, PurchaseModuleDto, ReinstateSubscriptionDto, } from './billing';
18
- export { InvoicesReadsResource, InvoicesResource } from './billing/invoices';
19
15
  export { GetInvoicesQueryDto, InvoiceIdDto } from './billing/invoices';
20
- export { StatusesResource } from './statuses';
21
16
  export { AddStatusDto, GetStatusesDto, StatusIdDto, UpdateStatusDto } from './statuses';
22
- export { AdditionalDetailsResource } from './additional-details';
23
17
  export { AddAdditionalDetailsDto, AdditionalDetailsIdDto, GetAdditionalDetailsDto, IsAdditionalDetailsValueByType, UpdateAdditionalDetailsDto, } from './additional-details';
24
- export { NotesResource } from './notes';
25
18
  export { AddNoteDto, GetNotesDto, NoteIdDto } from './notes';
26
- export { NotificationsResource, NotificationsOutboxResource } from './notifications';
27
19
  export type { CreateNotificationInput, CreatedNotification, NotificationContentRow, OrganizationTableFactory, QueuedNotification, } from './notifications';
28
20
  export { GetNotificationsDto, NotificationIdDto } from './notifications';
29
- export { OrganizationInvitesResource } from './organization-invites';
30
21
  export type { OrganizationInvite } from './organization-invites';
31
- export { OrganizationPaymentMethodsResource } from './organization-payment-methods';
32
22
  export type { OrganizationPaymentMethod, PaymentMethodLookupColumn, } from './organization-payment-methods';
33
- export { OrganizationsResource, OrganizationSignupResource } from './organizations';
34
23
  export type { CreateOrganizationRow, OrganizationRow } from './organizations';
35
24
  export { CreateOrganizationDto, UpdateOrganizationDto } from './organizations';
36
25
  export { PermissionsResource } from './permissions';
37
26
  export type { PermissionFlags } from './permissions';
38
27
  export { UpdatePermissionsDto } from './permissions';
39
- export { UsersResource } from './users';
40
28
  export type { UserRow } from './users';
41
29
  export { AddUserDto, GetUsersQueryDto, UpdateMyProfileDto, UpdateUserDto, UserIdDto, } from './users';
42
- export { WebhookEventsResource } from './webhook-events';
43
30
  export type { ClaimOutcome, WebhookEventRow, WebhookEventsTable } from './webhook-events';
44
- export { SupportingFilesResource } from './supporting-files';
45
31
  export { GetSupportingFilesDto, SupportingFileIdDto } from './supporting-files';
46
- export { ClientsResource } from './clients';
47
32
  export { ClientIdDto, CreateClientDto, GetClientsDto, UpdateClientDto } from './clients';
48
- export { ProjectsResource } from './projects';
49
33
  export { CreateProjectDto, GetProjectsDto, ProjectIdDto, UpdateProjectDto } from './projects';
50
- export { TasksResource } from './tasks';
51
34
  export { CreateTaskDto, GetTasksDto, TaskIdDto, UpdateTaskDto } from './tasks';
52
- export { PricebooksResource, monthlyTotalMinor } from './pricebooks';
35
+ export { monthlyTotalMinor } from './pricebooks';
package/dist/index.js CHANGED
@@ -2,14 +2,16 @@
2
2
  // The package's public surface, spelled out. Anything not listed here is the SDK's own plumbing —
3
3
  // the audit diff, the row helpers, the select-string fragments, the error mappers — and stays
4
4
  // reachable only from inside. The `./nest` entrypoint is listed separately, in src/nest/index.ts.
5
+ //
6
+ // Resources are reached through the three clients (`supabase.tasks`, `scope.invoices`, ...), so
7
+ // their classes are not exported: a consumer never constructs one, and every export is a contract
8
+ // to keep. The row and input types they produce and accept are exported for annotations.
5
9
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.OrganizationSignupResource = exports.OrganizationsResource = exports.OrganizationPaymentMethodsResource = exports.OrganizationInvitesResource = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NotificationsOutboxResource = exports.NotificationsResource = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.NotesResource = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.AdditionalDetailsResource = exports.UpdateStatusDto = exports.StatusIdDto = exports.GetStatusesDto = exports.AddStatusDto = exports.StatusesResource = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.InvoicesResource = exports.InvoicesReadsResource = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.InitialPaymentDto = exports.CancelSubscriptionDto = exports.BillingResource = exports.BillingReadsResource = exports.GetAuditTrailDto = exports.AuditResource = exports.IsNullable = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseOrganizationScope = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.verifyAccessToken = exports.createSupabaseClient = exports.SupabaseClient = void 0;
7
- exports.monthlyTotalMinor = exports.PricebooksResource = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.TasksResource = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.ProjectsResource = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = exports.ClientsResource = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.SupportingFilesResource = exports.WebhookEventsResource = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UsersResource = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = void 0;
10
+ exports.CreateProjectDto = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.UpdateStatusDto = exports.StatusIdDto = exports.GetStatusesDto = exports.AddStatusDto = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.InitialPaymentDto = exports.CancelSubscriptionDto = exports.GetAuditTrailDto = exports.IsNullable = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.createSupabaseClient = exports.SupabaseClient = void 0;
11
+ exports.monthlyTotalMinor = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = void 0;
8
12
  var client_1 = require("./client");
9
13
  Object.defineProperty(exports, "SupabaseClient", { enumerable: true, get: function () { return client_1.SupabaseClient; } });
10
14
  Object.defineProperty(exports, "createSupabaseClient", { enumerable: true, get: function () { return client_1.createSupabaseClient; } });
11
- var auth_1 = require("./auth");
12
- Object.defineProperty(exports, "verifyAccessToken", { enumerable: true, get: function () { return auth_1.verifyAccessToken; } });
13
15
  var auth_client_1 = require("./auth-client");
14
16
  Object.defineProperty(exports, "SupabaseAuthClient", { enumerable: true, get: function () { return auth_client_1.SupabaseAuthClient; } });
15
17
  Object.defineProperty(exports, "createSupabaseAuthClient", { enumerable: true, get: function () { return auth_client_1.createSupabaseAuthClient; } });
@@ -21,108 +23,71 @@ Object.defineProperty(exports, "SendPasswordResetEmailDto", { enumerable: true,
21
23
  Object.defineProperty(exports, "SignInDto", { enumerable: true, get: function () { return auth_client_2.SignInDto; } });
22
24
  var service_client_1 = require("./service-client");
23
25
  Object.defineProperty(exports, "SupabaseServiceClient", { enumerable: true, get: function () { return service_client_1.SupabaseServiceClient; } });
24
- Object.defineProperty(exports, "SupabaseOrganizationScope", { enumerable: true, get: function () { return service_client_1.SupabaseOrganizationScope; } });
25
26
  Object.defineProperty(exports, "createSupabaseServiceClient", { enumerable: true, get: function () { return service_client_1.createSupabaseServiceClient; } });
26
27
  var errors_1 = require("./errors");
27
28
  Object.defineProperty(exports, "SupabaseClientError", { enumerable: true, get: function () { return errors_1.SupabaseClientError; } });
28
29
  var validators_1 = require("./validators");
29
30
  Object.defineProperty(exports, "IsNullable", { enumerable: true, get: function () { return validators_1.IsNullable; } });
30
31
  var audit_1 = require("./audit");
31
- Object.defineProperty(exports, "AuditResource", { enumerable: true, get: function () { return audit_1.AuditResource; } });
32
- var audit_2 = require("./audit");
33
- Object.defineProperty(exports, "GetAuditTrailDto", { enumerable: true, get: function () { return audit_2.GetAuditTrailDto; } });
32
+ Object.defineProperty(exports, "GetAuditTrailDto", { enumerable: true, get: function () { return audit_1.GetAuditTrailDto; } });
34
33
  var billing_1 = require("./billing");
35
- Object.defineProperty(exports, "BillingReadsResource", { enumerable: true, get: function () { return billing_1.BillingReadsResource; } });
36
- Object.defineProperty(exports, "BillingResource", { enumerable: true, get: function () { return billing_1.BillingResource; } });
37
- var billing_2 = require("./billing");
38
- Object.defineProperty(exports, "CancelSubscriptionDto", { enumerable: true, get: function () { return billing_2.CancelSubscriptionDto; } });
39
- Object.defineProperty(exports, "InitialPaymentDto", { enumerable: true, get: function () { return billing_2.InitialPaymentDto; } });
40
- Object.defineProperty(exports, "PurchaseModuleDto", { enumerable: true, get: function () { return billing_2.PurchaseModuleDto; } });
41
- Object.defineProperty(exports, "ReinstateSubscriptionDto", { enumerable: true, get: function () { return billing_2.ReinstateSubscriptionDto; } });
34
+ Object.defineProperty(exports, "CancelSubscriptionDto", { enumerable: true, get: function () { return billing_1.CancelSubscriptionDto; } });
35
+ Object.defineProperty(exports, "InitialPaymentDto", { enumerable: true, get: function () { return billing_1.InitialPaymentDto; } });
36
+ Object.defineProperty(exports, "PurchaseModuleDto", { enumerable: true, get: function () { return billing_1.PurchaseModuleDto; } });
37
+ Object.defineProperty(exports, "ReinstateSubscriptionDto", { enumerable: true, get: function () { return billing_1.ReinstateSubscriptionDto; } });
42
38
  var invoices_1 = require("./billing/invoices");
43
- Object.defineProperty(exports, "InvoicesReadsResource", { enumerable: true, get: function () { return invoices_1.InvoicesReadsResource; } });
44
- Object.defineProperty(exports, "InvoicesResource", { enumerable: true, get: function () { return invoices_1.InvoicesResource; } });
45
- var invoices_2 = require("./billing/invoices");
46
- Object.defineProperty(exports, "GetInvoicesQueryDto", { enumerable: true, get: function () { return invoices_2.GetInvoicesQueryDto; } });
47
- Object.defineProperty(exports, "InvoiceIdDto", { enumerable: true, get: function () { return invoices_2.InvoiceIdDto; } });
39
+ Object.defineProperty(exports, "GetInvoicesQueryDto", { enumerable: true, get: function () { return invoices_1.GetInvoicesQueryDto; } });
40
+ Object.defineProperty(exports, "InvoiceIdDto", { enumerable: true, get: function () { return invoices_1.InvoiceIdDto; } });
48
41
  var statuses_1 = require("./statuses");
49
- Object.defineProperty(exports, "StatusesResource", { enumerable: true, get: function () { return statuses_1.StatusesResource; } });
50
- var statuses_2 = require("./statuses");
51
- Object.defineProperty(exports, "AddStatusDto", { enumerable: true, get: function () { return statuses_2.AddStatusDto; } });
52
- Object.defineProperty(exports, "GetStatusesDto", { enumerable: true, get: function () { return statuses_2.GetStatusesDto; } });
53
- Object.defineProperty(exports, "StatusIdDto", { enumerable: true, get: function () { return statuses_2.StatusIdDto; } });
54
- Object.defineProperty(exports, "UpdateStatusDto", { enumerable: true, get: function () { return statuses_2.UpdateStatusDto; } });
42
+ Object.defineProperty(exports, "AddStatusDto", { enumerable: true, get: function () { return statuses_1.AddStatusDto; } });
43
+ Object.defineProperty(exports, "GetStatusesDto", { enumerable: true, get: function () { return statuses_1.GetStatusesDto; } });
44
+ Object.defineProperty(exports, "StatusIdDto", { enumerable: true, get: function () { return statuses_1.StatusIdDto; } });
45
+ Object.defineProperty(exports, "UpdateStatusDto", { enumerable: true, get: function () { return statuses_1.UpdateStatusDto; } });
55
46
  var additional_details_1 = require("./additional-details");
56
- Object.defineProperty(exports, "AdditionalDetailsResource", { enumerable: true, get: function () { return additional_details_1.AdditionalDetailsResource; } });
57
- var additional_details_2 = require("./additional-details");
58
- Object.defineProperty(exports, "AddAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_2.AddAdditionalDetailsDto; } });
59
- Object.defineProperty(exports, "AdditionalDetailsIdDto", { enumerable: true, get: function () { return additional_details_2.AdditionalDetailsIdDto; } });
60
- Object.defineProperty(exports, "GetAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_2.GetAdditionalDetailsDto; } });
61
- Object.defineProperty(exports, "IsAdditionalDetailsValueByType", { enumerable: true, get: function () { return additional_details_2.IsAdditionalDetailsValueByType; } });
62
- Object.defineProperty(exports, "UpdateAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_2.UpdateAdditionalDetailsDto; } });
47
+ Object.defineProperty(exports, "AddAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_1.AddAdditionalDetailsDto; } });
48
+ Object.defineProperty(exports, "AdditionalDetailsIdDto", { enumerable: true, get: function () { return additional_details_1.AdditionalDetailsIdDto; } });
49
+ Object.defineProperty(exports, "GetAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_1.GetAdditionalDetailsDto; } });
50
+ Object.defineProperty(exports, "IsAdditionalDetailsValueByType", { enumerable: true, get: function () { return additional_details_1.IsAdditionalDetailsValueByType; } });
51
+ Object.defineProperty(exports, "UpdateAdditionalDetailsDto", { enumerable: true, get: function () { return additional_details_1.UpdateAdditionalDetailsDto; } });
63
52
  var notes_1 = require("./notes");
64
- Object.defineProperty(exports, "NotesResource", { enumerable: true, get: function () { return notes_1.NotesResource; } });
65
- var notes_2 = require("./notes");
66
- Object.defineProperty(exports, "AddNoteDto", { enumerable: true, get: function () { return notes_2.AddNoteDto; } });
67
- Object.defineProperty(exports, "GetNotesDto", { enumerable: true, get: function () { return notes_2.GetNotesDto; } });
68
- Object.defineProperty(exports, "NoteIdDto", { enumerable: true, get: function () { return notes_2.NoteIdDto; } });
53
+ Object.defineProperty(exports, "AddNoteDto", { enumerable: true, get: function () { return notes_1.AddNoteDto; } });
54
+ Object.defineProperty(exports, "GetNotesDto", { enumerable: true, get: function () { return notes_1.GetNotesDto; } });
55
+ Object.defineProperty(exports, "NoteIdDto", { enumerable: true, get: function () { return notes_1.NoteIdDto; } });
69
56
  var notifications_1 = require("./notifications");
70
- Object.defineProperty(exports, "NotificationsResource", { enumerable: true, get: function () { return notifications_1.NotificationsResource; } });
71
- Object.defineProperty(exports, "NotificationsOutboxResource", { enumerable: true, get: function () { return notifications_1.NotificationsOutboxResource; } });
72
- var notifications_2 = require("./notifications");
73
- Object.defineProperty(exports, "GetNotificationsDto", { enumerable: true, get: function () { return notifications_2.GetNotificationsDto; } });
74
- Object.defineProperty(exports, "NotificationIdDto", { enumerable: true, get: function () { return notifications_2.NotificationIdDto; } });
75
- var organization_invites_1 = require("./organization-invites");
76
- Object.defineProperty(exports, "OrganizationInvitesResource", { enumerable: true, get: function () { return organization_invites_1.OrganizationInvitesResource; } });
77
- var organization_payment_methods_1 = require("./organization-payment-methods");
78
- Object.defineProperty(exports, "OrganizationPaymentMethodsResource", { enumerable: true, get: function () { return organization_payment_methods_1.OrganizationPaymentMethodsResource; } });
57
+ Object.defineProperty(exports, "GetNotificationsDto", { enumerable: true, get: function () { return notifications_1.GetNotificationsDto; } });
58
+ Object.defineProperty(exports, "NotificationIdDto", { enumerable: true, get: function () { return notifications_1.NotificationIdDto; } });
79
59
  var organizations_1 = require("./organizations");
80
- Object.defineProperty(exports, "OrganizationsResource", { enumerable: true, get: function () { return organizations_1.OrganizationsResource; } });
81
- Object.defineProperty(exports, "OrganizationSignupResource", { enumerable: true, get: function () { return organizations_1.OrganizationSignupResource; } });
82
- var organizations_2 = require("./organizations");
83
- Object.defineProperty(exports, "CreateOrganizationDto", { enumerable: true, get: function () { return organizations_2.CreateOrganizationDto; } });
84
- Object.defineProperty(exports, "UpdateOrganizationDto", { enumerable: true, get: function () { return organizations_2.UpdateOrganizationDto; } });
60
+ Object.defineProperty(exports, "CreateOrganizationDto", { enumerable: true, get: function () { return organizations_1.CreateOrganizationDto; } });
61
+ Object.defineProperty(exports, "UpdateOrganizationDto", { enumerable: true, get: function () { return organizations_1.UpdateOrganizationDto; } });
62
+ // The one resource class still exported: the api's permissions guard spec drives a real
63
+ // PermissionsResource over a stubbed client.
85
64
  var permissions_1 = require("./permissions");
86
65
  Object.defineProperty(exports, "PermissionsResource", { enumerable: true, get: function () { return permissions_1.PermissionsResource; } });
87
66
  var permissions_2 = require("./permissions");
88
67
  Object.defineProperty(exports, "UpdatePermissionsDto", { enumerable: true, get: function () { return permissions_2.UpdatePermissionsDto; } });
89
68
  var users_1 = require("./users");
90
- Object.defineProperty(exports, "UsersResource", { enumerable: true, get: function () { return users_1.UsersResource; } });
91
- var users_2 = require("./users");
92
- Object.defineProperty(exports, "AddUserDto", { enumerable: true, get: function () { return users_2.AddUserDto; } });
93
- Object.defineProperty(exports, "GetUsersQueryDto", { enumerable: true, get: function () { return users_2.GetUsersQueryDto; } });
94
- Object.defineProperty(exports, "UpdateMyProfileDto", { enumerable: true, get: function () { return users_2.UpdateMyProfileDto; } });
95
- Object.defineProperty(exports, "UpdateUserDto", { enumerable: true, get: function () { return users_2.UpdateUserDto; } });
96
- Object.defineProperty(exports, "UserIdDto", { enumerable: true, get: function () { return users_2.UserIdDto; } });
97
- var webhook_events_1 = require("./webhook-events");
98
- Object.defineProperty(exports, "WebhookEventsResource", { enumerable: true, get: function () { return webhook_events_1.WebhookEventsResource; } });
69
+ Object.defineProperty(exports, "AddUserDto", { enumerable: true, get: function () { return users_1.AddUserDto; } });
70
+ Object.defineProperty(exports, "GetUsersQueryDto", { enumerable: true, get: function () { return users_1.GetUsersQueryDto; } });
71
+ Object.defineProperty(exports, "UpdateMyProfileDto", { enumerable: true, get: function () { return users_1.UpdateMyProfileDto; } });
72
+ Object.defineProperty(exports, "UpdateUserDto", { enumerable: true, get: function () { return users_1.UpdateUserDto; } });
73
+ Object.defineProperty(exports, "UserIdDto", { enumerable: true, get: function () { return users_1.UserIdDto; } });
99
74
  var supporting_files_1 = require("./supporting-files");
100
- Object.defineProperty(exports, "SupportingFilesResource", { enumerable: true, get: function () { return supporting_files_1.SupportingFilesResource; } });
101
- var supporting_files_2 = require("./supporting-files");
102
- Object.defineProperty(exports, "GetSupportingFilesDto", { enumerable: true, get: function () { return supporting_files_2.GetSupportingFilesDto; } });
103
- Object.defineProperty(exports, "SupportingFileIdDto", { enumerable: true, get: function () { return supporting_files_2.SupportingFileIdDto; } });
75
+ Object.defineProperty(exports, "GetSupportingFilesDto", { enumerable: true, get: function () { return supporting_files_1.GetSupportingFilesDto; } });
76
+ Object.defineProperty(exports, "SupportingFileIdDto", { enumerable: true, get: function () { return supporting_files_1.SupportingFileIdDto; } });
104
77
  var clients_1 = require("./clients");
105
- Object.defineProperty(exports, "ClientsResource", { enumerable: true, get: function () { return clients_1.ClientsResource; } });
106
- var clients_2 = require("./clients");
107
- Object.defineProperty(exports, "ClientIdDto", { enumerable: true, get: function () { return clients_2.ClientIdDto; } });
108
- Object.defineProperty(exports, "CreateClientDto", { enumerable: true, get: function () { return clients_2.CreateClientDto; } });
109
- Object.defineProperty(exports, "GetClientsDto", { enumerable: true, get: function () { return clients_2.GetClientsDto; } });
110
- Object.defineProperty(exports, "UpdateClientDto", { enumerable: true, get: function () { return clients_2.UpdateClientDto; } });
78
+ Object.defineProperty(exports, "ClientIdDto", { enumerable: true, get: function () { return clients_1.ClientIdDto; } });
79
+ Object.defineProperty(exports, "CreateClientDto", { enumerable: true, get: function () { return clients_1.CreateClientDto; } });
80
+ Object.defineProperty(exports, "GetClientsDto", { enumerable: true, get: function () { return clients_1.GetClientsDto; } });
81
+ Object.defineProperty(exports, "UpdateClientDto", { enumerable: true, get: function () { return clients_1.UpdateClientDto; } });
111
82
  var projects_1 = require("./projects");
112
- Object.defineProperty(exports, "ProjectsResource", { enumerable: true, get: function () { return projects_1.ProjectsResource; } });
113
- var projects_2 = require("./projects");
114
- Object.defineProperty(exports, "CreateProjectDto", { enumerable: true, get: function () { return projects_2.CreateProjectDto; } });
115
- Object.defineProperty(exports, "GetProjectsDto", { enumerable: true, get: function () { return projects_2.GetProjectsDto; } });
116
- Object.defineProperty(exports, "ProjectIdDto", { enumerable: true, get: function () { return projects_2.ProjectIdDto; } });
117
- Object.defineProperty(exports, "UpdateProjectDto", { enumerable: true, get: function () { return projects_2.UpdateProjectDto; } });
83
+ Object.defineProperty(exports, "CreateProjectDto", { enumerable: true, get: function () { return projects_1.CreateProjectDto; } });
84
+ Object.defineProperty(exports, "GetProjectsDto", { enumerable: true, get: function () { return projects_1.GetProjectsDto; } });
85
+ Object.defineProperty(exports, "ProjectIdDto", { enumerable: true, get: function () { return projects_1.ProjectIdDto; } });
86
+ Object.defineProperty(exports, "UpdateProjectDto", { enumerable: true, get: function () { return projects_1.UpdateProjectDto; } });
118
87
  var tasks_1 = require("./tasks");
119
- Object.defineProperty(exports, "TasksResource", { enumerable: true, get: function () { return tasks_1.TasksResource; } });
120
- var tasks_2 = require("./tasks");
121
- Object.defineProperty(exports, "CreateTaskDto", { enumerable: true, get: function () { return tasks_2.CreateTaskDto; } });
122
- Object.defineProperty(exports, "GetTasksDto", { enumerable: true, get: function () { return tasks_2.GetTasksDto; } });
123
- Object.defineProperty(exports, "TaskIdDto", { enumerable: true, get: function () { return tasks_2.TaskIdDto; } });
124
- Object.defineProperty(exports, "UpdateTaskDto", { enumerable: true, get: function () { return tasks_2.UpdateTaskDto; } });
88
+ Object.defineProperty(exports, "CreateTaskDto", { enumerable: true, get: function () { return tasks_1.CreateTaskDto; } });
89
+ Object.defineProperty(exports, "GetTasksDto", { enumerable: true, get: function () { return tasks_1.GetTasksDto; } });
90
+ Object.defineProperty(exports, "TaskIdDto", { enumerable: true, get: function () { return tasks_1.TaskIdDto; } });
91
+ Object.defineProperty(exports, "UpdateTaskDto", { enumerable: true, get: function () { return tasks_1.UpdateTaskDto; } });
125
92
  var pricebooks_1 = require("./pricebooks");
126
- Object.defineProperty(exports, "PricebooksResource", { enumerable: true, get: function () { return pricebooks_1.PricebooksResource; } });
127
93
  Object.defineProperty(exports, "monthlyTotalMinor", { enumerable: true, get: function () { return pricebooks_1.monthlyTotalMinor; } });
128
- //# sourceMappingURL=index.js.map
@@ -55,5 +55,10 @@ export declare const createSupabaseServiceClientFromEnv: (options?: SupabaseUser
55
55
  /**
56
56
  * A `SupabaseAuthClient` for routes a logged-out caller hits (sign-in, refresh, password
57
57
  * reset) — built from the publishable key alone, with no bearer token involved.
58
+ *
59
+ * Deliberately a fresh client per request, not a module-level singleton: supabase-js keeps the
60
+ * session `signIn`, `verifyOtp` and `setSession` produce in the client's own memory, so one
61
+ * shared instance would let concurrent sign-in and reset-password requests read each other's
62
+ * sessions. The construction is cheap (no network) and the isolation is the point.
58
63
  */
59
64
  export declare const SupabasePublicClient: (...dataOrPipes: any[]) => ParameterDecorator;
@@ -114,9 +114,13 @@ exports.createSupabaseServiceClientFromEnv = createSupabaseServiceClientFromEnv;
114
114
  /**
115
115
  * A `SupabaseAuthClient` for routes a logged-out caller hits (sign-in, refresh, password
116
116
  * reset) — built from the publishable key alone, with no bearer token involved.
117
+ *
118
+ * Deliberately a fresh client per request, not a module-level singleton: supabase-js keeps the
119
+ * session `signIn`, `verifyOtp` and `setSession` produce in the client's own memory, so one
120
+ * shared instance would let concurrent sign-in and reset-password requests read each other's
121
+ * sessions. The construction is cheap (no network) and the isolation is the point.
117
122
  */
118
123
  exports.SupabasePublicClient = (0, common_1.createParamDecorator)(() => (0, auth_client_1.createSupabaseAuthClient)({
119
124
  url: getEnvOrThrow('SUPABASE_URL'),
120
125
  key: getEnvOrThrow('SUPABASE_PUBLISHABLE_KEY'),
121
126
  }));
122
- //# sourceMappingURL=index.js.map
package/dist/notes/dto.js CHANGED
@@ -45,4 +45,3 @@ __decorate([
45
45
  (0, class_validator_1.MaxLength)(255, { message: 'Content cannot exceed 255 characters' }),
46
46
  __metadata("design:type", String)
47
47
  ], AddNoteDto.prototype, "content", void 0);
48
- //# sourceMappingURL=dto.js.map
@@ -82,4 +82,3 @@ class NotesResource {
82
82
  }
83
83
  }
84
84
  exports.NotesResource = NotesResource;
85
- //# sourceMappingURL=index.js.map
@@ -60,4 +60,3 @@ __decorate([
60
60
  (0, class_validator_1.IsBoolean)({ message: 'Unread only must be a boolean' }),
61
61
  __metadata("design:type", Boolean)
62
62
  ], GetNotificationsDto.prototype, "unread", void 0);
63
- //# sourceMappingURL=dto.js.map
@@ -354,4 +354,3 @@ class NotificationsOutboxResource {
354
354
  }
355
355
  }
356
356
  exports.NotificationsOutboxResource = NotificationsOutboxResource;
357
- //# sourceMappingURL=index.js.map