@pithy-sh/payments 0.8.1 → 0.8.3

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.
@@ -30,10 +30,15 @@ export interface PaymentsConfigParams {
30
30
  /** The target environment. */
31
31
  env: ManagedEnvironment;
32
32
  /**
33
- * **The feature this host serves, when it serves one (#643).** Its Worker, its Workflows and every store
33
+ * **The feature this host serves, when it serves one.** Its Worker, its Workflows and every store
34
34
  * entry it binds then take the feature's names, as every feature host's do; `env` is `feature`.
35
35
  */
36
36
  feature?: FeatureIdentity;
37
+ /**
38
+ * The `apps/<owner>` Worker whose own host this is, when it owns a binding the host binds. The Worker and its
39
+ * Workflows then carry `<owner>---<capability>`, so it never takes the shared host's names.
40
+ */
41
+ owner?: string;
37
42
  /** The app database id for this environment — where the `pithy_payments_*` tables live. */
38
43
  appDatabaseId: string;
39
44
  /** This environment's secrets database id (`<project>-<env>-secrets`) — holds the rails' credentials. */
@@ -1 +1 @@
1
- {"version":3,"file":"resolvePaymentsConfig.d.ts","sourceRoot":"","sources":["../../src/provision/resolvePaymentsConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAyC,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;;;;;;;;;;;;GAaG;AAEH,yFAAyF;AACzF,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,GAAG,EAAE,kBAAkB,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2FAA2F;IAC3F,aAAa,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,iBAAiB,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;AAED,6CAA6C;AAC7C,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,oBAAoB,GAC3B,oBAAoB,CAuCtB"}
@@ -18,18 +18,21 @@ function paymentsWorkerName(project, env) {
18
18
  /** Fill the template for one environment. */
19
19
  function resolvePaymentsConfig(template, params) {
20
20
  const feature = params.feature;
21
+ const owner = params.owner;
21
22
  const { project, env, appDatabaseId, secretsDatabaseId, storeId, paymentsConfig } = params;
22
23
  const derived = hostWorkflowsFor(paymentsWorkflowRegistry, {
23
24
  project,
24
25
  capability: PAYMENTS_CAPABILITY,
25
26
  env,
26
- ...feature ? { feature } : {}
27
+ ...feature ? { feature } : {},
28
+ ...owner !== void 0 ? { owner } : {}
27
29
  });
28
30
  const resolved = resolveWorkflowHost(template, {
29
31
  project,
30
32
  capability: PAYMENTS_CAPABILITY,
31
33
  env,
32
34
  ...feature ? { feature } : {},
35
+ ...owner !== void 0 ? { owner } : {},
33
36
  databaseIds: {
34
37
  DB: appDatabaseId,
35
38
  SECRETS: secretsDatabaseId
@@ -3,5 +3,5 @@
3
3
  /** This package's npm name — the join key against a release feed. */
4
4
  export declare const PACKAGE_NAME = "@pithy-sh/payments";
5
5
  /** This package's version, stamped from its own package.json at generation time. */
6
- export declare const PACKAGE_VERSION = "0.8.1";
6
+ export declare const PACKAGE_VERSION = "0.8.3";
7
7
  //# sourceMappingURL=version.generated.d.ts.map
@@ -4,6 +4,6 @@
4
4
  /** This package's npm name — the join key against a release feed. */
5
5
  const PACKAGE_NAME = "@pithy-sh/payments";
6
6
  /** This package's version, stamped from its own package.json at generation time. */
7
- const PACKAGE_VERSION = "0.8.1";
7
+ const PACKAGE_VERSION = "0.8.3";
8
8
  //#endregion
9
9
  export { PACKAGE_NAME, PACKAGE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pithy-sh/payments",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,9 +42,9 @@
42
42
  "@paddle/paddle-js": "^1.6.4"
43
43
  },
44
44
  "peerDependencies": {
45
- "@pithy-sh/core": "^0.18.0",
46
- "@pithy-sh/ledger": "^0.6.4",
47
- "@pithy-sh/secrets": "^0.6.6",
45
+ "@pithy-sh/core": "^0.20.0",
46
+ "@pithy-sh/ledger": "^0.6.6",
47
+ "@pithy-sh/secrets": "^0.6.8",
48
48
  "@pithy-sh/ui-core": "^0.1.0",
49
49
  "hono": "^4.13.2",
50
50
  "kysely": "^0.29.0",
@@ -36,10 +36,15 @@ export interface PaymentsConfigParams {
36
36
  /** The target environment. */
37
37
  env: ManagedEnvironment;
38
38
  /**
39
- * **The feature this host serves, when it serves one (#643).** Its Worker, its Workflows and every store
39
+ * **The feature this host serves, when it serves one.** Its Worker, its Workflows and every store
40
40
  * entry it binds then take the feature's names, as every feature host's do; `env` is `feature`.
41
41
  */
42
42
  feature?: FeatureIdentity;
43
+ /**
44
+ * The `apps/<owner>` Worker whose own host this is, when it owns a binding the host binds. The Worker and its
45
+ * Workflows then carry `<owner>---<capability>`, so it never takes the shared host's names.
46
+ */
47
+ owner?: string;
43
48
  /** The app database id for this environment — where the `pithy_payments_*` tables live. */
44
49
  appDatabaseId: string;
45
50
  /** This environment's secrets database id (`<project>-<env>-secrets`) — holds the rails' credentials. */
@@ -67,6 +72,7 @@ export function resolvePaymentsConfig(
67
72
  params: PaymentsConfigParams,
68
73
  ): WorkflowHostTemplate {
69
74
  const feature = params.feature;
75
+ const owner = params.owner;
70
76
  const { project, env, appDatabaseId, secretsDatabaseId, storeId, paymentsConfig } = params;
71
77
 
72
78
  // Derived before the resolve rather than assigned after it: `resolveWorkflowHost` refuses to fill a
@@ -77,6 +83,7 @@ export function resolvePaymentsConfig(
77
83
  capability: PAYMENTS_CAPABILITY,
78
84
  env,
79
85
  ...(feature ? { feature } : {}),
86
+ ...(owner !== undefined ? { owner } : {}),
80
87
  });
81
88
 
82
89
  const resolved = resolveWorkflowHost(template, {
@@ -84,6 +91,7 @@ export function resolvePaymentsConfig(
84
91
  capability: PAYMENTS_CAPABILITY,
85
92
  env,
86
93
  ...(feature ? { feature } : {}),
94
+ ...(owner !== undefined ? { owner } : {}),
87
95
  databaseIds: { DB: appDatabaseId, SECRETS: secretsDatabaseId },
88
96
  secretsStoreId: storeId,
89
97
  // The master key entry is project- and env-scoped, matching what the secrets manager wrote.
@@ -13,4 +13,4 @@
13
13
  export const PACKAGE_NAME = "@pithy-sh/payments";
14
14
 
15
15
  /** This package's version, stamped from its own package.json at generation time. */
16
- export const PACKAGE_VERSION = "0.8.1";
16
+ export const PACKAGE_VERSION = "0.8.3";