@pithy-sh/storage 0.7.5 → 0.7.6
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/dist/provision/resolveStorageConfig.d.ts +6 -1
- package/dist/provision/resolveStorageConfig.d.ts.map +1 -1
- package/dist/provision/resolveStorageConfig.js +4 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +4 -4
- package/src/provision/resolveStorageConfig.ts +9 -1
- package/src/version.generated.ts +1 -1
|
@@ -31,10 +31,15 @@ export interface StorageConfigParams {
|
|
|
31
31
|
/** The target environment. */
|
|
32
32
|
env: ManagedEnvironment;
|
|
33
33
|
/**
|
|
34
|
-
* **The feature this host serves, when it serves one
|
|
34
|
+
* **The feature this host serves, when it serves one.** Its Worker, its Workflows and every store
|
|
35
35
|
* entry it binds then take the feature's names, as every feature host's do; `env` is `feature`.
|
|
36
36
|
*/
|
|
37
37
|
feature?: FeatureIdentity;
|
|
38
|
+
/**
|
|
39
|
+
* The `apps/<owner>` Worker whose own host this is, when it owns a binding the host binds. The Worker and its
|
|
40
|
+
* Workflows then carry `<owner>---<capability>`, so it never takes the shared host's names.
|
|
41
|
+
*/
|
|
42
|
+
owner?: string;
|
|
38
43
|
/** The app database id for this environment — where the `pithy_storage_*` tables live. */
|
|
39
44
|
appDatabaseId: string;
|
|
40
45
|
/** This environment's secrets database id (`<project>-<env>-secrets`) — holds the R2 credentials. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveStorageConfig.d.ts","sourceRoot":"","sources":["../../src/provision/resolveStorageConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAyC,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa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AC,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,SAAS,EAAE,gBAAgB,CAAC;IAC5B,6FAA6F;IAC7F,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,mBAAmB,GAC1B,oBAAoB,CAqCtB"}
|
|
@@ -7,18 +7,21 @@ import { hostWorkflowsFor, resolveWorkflowHost } from "@pithy-sh/core/src/workfl
|
|
|
7
7
|
/** Fill the template for one environment. */
|
|
8
8
|
function resolveStorageConfig(template, params) {
|
|
9
9
|
const feature = params.feature;
|
|
10
|
+
const owner = params.owner;
|
|
10
11
|
const { project, env, appDatabaseId, secretsDatabaseId, storeId, resources, storageConfig } = params;
|
|
11
12
|
const derived = hostWorkflowsFor(storageWorkflowRegistry, {
|
|
12
13
|
project,
|
|
13
14
|
capability: STORAGE_CAPABILITY,
|
|
14
15
|
env,
|
|
15
|
-
...feature ? { feature } : {}
|
|
16
|
+
...feature ? { feature } : {},
|
|
17
|
+
...owner !== void 0 ? { owner } : {}
|
|
16
18
|
});
|
|
17
19
|
const resolved = resolveWorkflowHost(template, {
|
|
18
20
|
project,
|
|
19
21
|
capability: STORAGE_CAPABILITY,
|
|
20
22
|
env,
|
|
21
23
|
...feature ? { feature } : {},
|
|
24
|
+
...owner !== void 0 ? { owner } : {},
|
|
22
25
|
databaseIds: {
|
|
23
26
|
DB: appDatabaseId,
|
|
24
27
|
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/storage";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.7.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.7.6";
|
|
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/storage";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.7.
|
|
7
|
+
const PACKAGE_VERSION = "0.7.6";
|
|
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/storage",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@hono/zod-validator": "^0.9.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@pithy-sh/cloudflare": "^0.10.
|
|
43
|
-
"@pithy-sh/core": "^0.
|
|
44
|
-
"@pithy-sh/secrets": "^0.6.
|
|
42
|
+
"@pithy-sh/cloudflare": "^0.10.3",
|
|
43
|
+
"@pithy-sh/core": "^0.20.0",
|
|
44
|
+
"@pithy-sh/secrets": "^0.6.8",
|
|
45
45
|
"hono": "^4.13.2",
|
|
46
46
|
"kysely": "^0.29.0",
|
|
47
47
|
"zod": "^4.4.0"
|
|
@@ -36,10 +36,15 @@ export interface StorageConfigParams {
|
|
|
36
36
|
/** The target environment. */
|
|
37
37
|
env: ManagedEnvironment;
|
|
38
38
|
/**
|
|
39
|
-
* **The feature this host serves, when it serves one
|
|
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_storage_*` tables live. */
|
|
44
49
|
appDatabaseId: string;
|
|
45
50
|
/** This environment's secrets database id (`<project>-<env>-secrets`) — holds the R2 credentials. */
|
|
@@ -58,6 +63,7 @@ export function resolveStorageConfig(
|
|
|
58
63
|
params: StorageConfigParams,
|
|
59
64
|
): WorkflowHostTemplate {
|
|
60
65
|
const feature = params.feature;
|
|
66
|
+
const owner = params.owner;
|
|
61
67
|
const { project, env, appDatabaseId, secretsDatabaseId, storeId, resources, storageConfig } = params;
|
|
62
68
|
|
|
63
69
|
// Derived before the resolve rather than assigned after it: `resolveWorkflowHost` refuses to fill a
|
|
@@ -68,6 +74,7 @@ export function resolveStorageConfig(
|
|
|
68
74
|
capability: STORAGE_CAPABILITY,
|
|
69
75
|
env,
|
|
70
76
|
...(feature ? { feature } : {}),
|
|
77
|
+
...(owner !== undefined ? { owner } : {}),
|
|
71
78
|
});
|
|
72
79
|
|
|
73
80
|
const resolved = resolveWorkflowHost(template, {
|
|
@@ -75,6 +82,7 @@ export function resolveStorageConfig(
|
|
|
75
82
|
capability: STORAGE_CAPABILITY,
|
|
76
83
|
env,
|
|
77
84
|
...(feature ? { feature } : {}),
|
|
85
|
+
...(owner !== undefined ? { owner } : {}),
|
|
78
86
|
databaseIds: { DB: appDatabaseId, SECRETS: secretsDatabaseId },
|
|
79
87
|
r2BucketNames: { STORAGE_BUCKET: resources.bucketName },
|
|
80
88
|
secretsStoreId: storeId,
|
package/src/version.generated.ts
CHANGED