@crvouga/mockingbird-service-stripe 2.3.1 → 3.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog — @crvouga/mockingbird-service-stripe
2
2
 
3
+ ## 3.0.0 (2026-10-07)
4
+
5
+ ### ⚠️ Breaking changes
6
+
7
+ - point the repo at crvouga/mockingbird ([1bf35a4](https://github.com/crvouga/mockingbird/commit/1bf35a422b84a85b50b09b72bd7cc7093082a86e))
8
+ - point the repo at crvouga/emulates ([cdb5e53](https://github.com/crvouga/mockingbird/commit/cdb5e536ed8c1f52345e3984f089001c25fdb08a))
9
+ - rename Emulators to Emulates ([2e10d9c](https://github.com/crvouga/mockingbird/commit/2e10d9cff84c54ac37768fc9a19d1aefd3943744))
10
+ - rebrand Mockingbird to Emulators ([1adca65](https://github.com/crvouga/mockingbird/commit/1adca65ce28242f11cff98eac05d2be88f680cbe))
11
+
12
+ ### Fixes and improvements
13
+
14
+ - typecheck the brand gate before builds ([fc36095](https://github.com/crvouga/mockingbird/commit/fc3609514de70ffe3170a5d216fb8a49f9ce7cbb))
15
+ - format the emulates records query ([8698872](https://github.com/crvouga/mockingbird/commit/8698872509d06002be5a8fcdc85d79f8462320c3))
16
+ - align rename fixtures and formatting ([69e0bee](https://github.com/crvouga/mockingbird/commit/69e0beefe44c9541e46740d3c177bde832340f90))
17
+
18
+ ### Dependencies
19
+
20
+ - `@crvouga/mockingbird-service-sqlite`
21
+
22
+ ## 2.3.2 (2026-10-05)
23
+
24
+ ### Fixes and improvements
25
+
26
+ - preserve Unicode feature names ([d0656f4](https://github.com/crvouga/mockingbird/commit/d0656f49905c78c301024117e1b727765d6ade2d))
27
+ - reject blank marketing features ([9546103](https://github.com/crvouga/mockingbird/commit/9546103a40d0e9c6f7a14dde36f9af3a405ca83e))
28
+ - reject empty customer accounts ([de4c228](https://github.com/crvouga/mockingbird/commit/de4c228831a823ee85309d2722375b31571d5b88))
29
+ - stabilize parity coverage and comparisons ([32eb860](https://github.com/crvouga/mockingbird/commit/32eb860e36590079bde991bebc1d5cb887a6f6eb))
30
+
3
31
  ## 2.3.1 (2026-10-05)
4
32
 
5
33
  ### Fixes and improvements
@@ -53,8 +53,38 @@ var CORE_MIGRATIONS = [
53
53
  `
54
54
  }
55
55
  ];
56
+ var LEGACY_TABLES = [
57
+ ["emulates_records", "mockingbird_records"],
58
+ ["emulators_records", "mockingbird_records"],
59
+ ["emulates_sequences", "mockingbird_sequences"],
60
+ ["emulators_sequences", "mockingbird_sequences"]
61
+ ];
62
+ var LEGACY_INDEXES = [
63
+ ["emulates_records_seq", "mockingbird_records_seq"],
64
+ ["emulators_records_seq", "mockingbird_records_seq"]
65
+ ];
66
+ var namesOf = (sqlite, type) => new Set(sqlite.prepare("SELECT name FROM sqlite_master WHERE type = ?").all(type).map((row) => row.name));
56
67
  var migrateCore = (sqlite) => {
57
68
  migrate(sqlite, CORE_MIGRATIONS);
69
+ const tables = namesOf(sqlite, "table");
70
+ const indexes = namesOf(sqlite, "index");
71
+ sqlite.transaction(() => {
72
+ for (const [from, to] of LEGACY_TABLES) {
73
+ if (!tables.has(from) || tables.has(to))
74
+ continue;
75
+ sqlite.exec(`ALTER TABLE ${from} RENAME TO ${to}`);
76
+ tables.delete(from);
77
+ tables.add(to);
78
+ }
79
+ for (const [from, to] of LEGACY_INDEXES) {
80
+ if (!indexes.has(from) || indexes.has(to))
81
+ continue;
82
+ sqlite.exec(`DROP INDEX ${from}`);
83
+ sqlite.exec(`CREATE INDEX ${to} ON mockingbird_records (namespace, collection, seq)`);
84
+ indexes.delete(from);
85
+ indexes.add(to);
86
+ }
87
+ });
58
88
  };
59
89
  var clearNamespace = (sqlite, namespace) => {
60
90
  sqlite.transaction(() => {
@@ -2363,7 +2393,7 @@ var stateAdminRoutes = (routes) => {
2363
2393
  };
2364
2394
 
2365
2395
  // ../core/dist/version.js
2366
- var PACKAGE_VERSION = true ? "2.3.1" : UNRELEASED_VERSION;
2396
+ var PACKAGE_VERSION = true ? "3.0.0" : UNRELEASED_VERSION;
2367
2397
 
2368
2398
  // ../core/dist/signing.js
2369
2399
  var encoder = new TextEncoder();
@@ -3825,7 +3855,7 @@ var optionalString = (params, key, current) => {
3825
3855
  if (value === "") return null;
3826
3856
  return value;
3827
3857
  };
3828
- var strip = (value) => value.replace(/^[\s\0]+|[\s\0]+$/g, "");
3858
+ var strip = (value) => value.replace(/^[\t\n\v\f\r \0]+|[\t\n\v\f\r \0]+$/g, "");
3829
3859
  var strippedString = (params, key, current) => {
3830
3860
  const value = params[key];
3831
3861
  if (value === void 0) return current;
@@ -8080,6 +8110,7 @@ var subscriptionHandlers = (services) => {
8080
8110
  GetSubscriptions: async (context) => {
8081
8111
  const scope = requestScope(services, context);
8082
8112
  const params = queryParams(context);
8113
+ if (context.query.customer_account === "") throw parameterInvalidEmpty("customer_account");
8083
8114
  const customer = stringOf(params, "customer");
8084
8115
  if (customer !== null && !scope.account.customers.get(customer))
8085
8116
  throw resourceMissing("customer", customer, "customer", 400);
@@ -10205,7 +10236,7 @@ var productValidators = (mode, current, prefix = "") => {
10205
10236
  marketing_features: (params) => {
10206
10237
  if (!Array.isArray(params.marketing_features)) return;
10207
10238
  params.marketing_features.forEach((feature, index) => {
10208
- if (feature?.name === "")
10239
+ if (typeof feature?.name === "string" && strip(feature.name) === "")
10209
10240
  throw parameterInvalidEmpty(`${at("marketing_features")}[${index}][name]`);
10210
10241
  });
10211
10242
  },
@@ -10237,7 +10268,7 @@ var apply = (current, params, now) => {
10237
10268
  // Stripe trims each feature name.
10238
10269
  params.marketing_features.map((feature) => ({
10239
10270
  ...feature,
10240
- name: feature.name.trim()
10271
+ name: strip(feature.name)
10241
10272
  }))
10242
10273
  );
10243
10274
  next.metadata = mergeMetadata(current.metadata, params.metadata);
@@ -19215,4 +19246,4 @@ export {
19215
19246
  createRuntime2 as createRuntime,
19216
19247
  StripeAPI
19217
19248
  };
19218
- //# sourceMappingURL=chunk-I2MCMD7N.js.map
19249
+ //# sourceMappingURL=chunk-EM57VSO7.js.map