@alethialabs/platform 0.2.0 → 0.3.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.
@@ -416,6 +416,23 @@ export declare const organizationBilling: import("drizzle-orm/pg-core").PgTableW
416
416
  identity: undefined;
417
417
  generated: undefined;
418
418
  }, {}, {}>;
419
+ paddleCustomerId: import("drizzle-orm/pg-core").PgColumn<{
420
+ name: "paddleCustomerId";
421
+ tableName: "organization_billing";
422
+ dataType: "string";
423
+ columnType: "PgText";
424
+ data: string;
425
+ driverParam: string;
426
+ notNull: false;
427
+ hasDefault: false;
428
+ isPrimaryKey: false;
429
+ isAutoincrement: false;
430
+ hasRuntimeDefault: false;
431
+ enumValues: [string, ...string[]];
432
+ baseColumn: never;
433
+ identity: undefined;
434
+ generated: undefined;
435
+ }, {}, {}>;
419
436
  paddleSubscriptionId: import("drizzle-orm/pg-core").PgColumn<{
420
437
  name: "paddleSubscriptionId";
421
438
  tableName: "organization_billing";
@@ -64,6 +64,7 @@ export const organizationBilling = pgTable("organization_billing", {
64
64
  status: billingStatus().notNull(),
65
65
  stripeCustomerId: text(),
66
66
  stripeSubscriptionId: text(),
67
+ paddleCustomerId: text(),
67
68
  paddleSubscriptionId: text(),
68
69
  seats: integer(),
69
70
  currentPeriodStart: timestamp({ withTimezone: true }),
@@ -0,0 +1,4 @@
1
+ /** A Paddle customer id: `ctm_` + 26 lowercase alphanumerics. */
2
+ export declare const PADDLE_CUSTOMER_ID_PATTERN: RegExp;
3
+ /** The message shown when a value does not match {@link PADDLE_CUSTOMER_ID_PATTERN}. */
4
+ export declare const PADDLE_CUSTOMER_ID_HINT = "A Paddle customer id is ctm_ followed by 26 lowercase letters and digits.";
package/dist/paddle.js ADDED
@@ -0,0 +1,9 @@
1
+ // SPDX-FileCopyrightText: 2026 Alethia Labs <legal@alethialabs.io>
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+ // The shape of a Paddle customer id, shared by the staff app (which checks what the operator typed)
4
+ // and the console (which re-checks it at its own boundary before writing the billing row). Paddle's
5
+ // API reference documents customer ids as `ctm_` followed by 26 lowercase letters and digits.
6
+ /** A Paddle customer id: `ctm_` + 26 lowercase alphanumerics. */
7
+ export const PADDLE_CUSTOMER_ID_PATTERN = /^ctm_[a-z0-9]{26}$/;
8
+ /** The message shown when a value does not match {@link PADDLE_CUSTOMER_ID_PATTERN}. */
9
+ export const PADDLE_CUSTOMER_ID_HINT = "A Paddle customer id is ctm_ followed by 26 lowercase letters and digits.";
package/dist/types.d.ts CHANGED
@@ -14,4 +14,8 @@ export interface PlatformAuditInput {
14
14
  slug?: string | null;
15
15
  stripeCustomerId?: string | null;
16
16
  stripeSubscriptionId?: string | null;
17
+ /** The Paddle customer id an operator linked to the org (link_paddle_customer). */
18
+ paddleCustomerId?: string | null;
19
+ /** The value it replaced, when the operator confirmed replacing one. */
20
+ replacedPaddleCustomerId?: string | null;
17
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alethialabs/platform",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Alethia platform records: enterprise contracts and the platform audit log, as Drizzle schema, enums and types.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Alethia Labs <legal@alethialabs.io>",
@@ -33,6 +33,10 @@
33
33
  "./console-refs": {
34
34
  "types": "./dist/console-refs.d.ts",
35
35
  "default": "./dist/console-refs.js"
36
+ },
37
+ "./paddle": {
38
+ "types": "./dist/paddle.d.ts",
39
+ "default": "./dist/paddle.js"
36
40
  }
37
41
  },
38
42
  "files": [