sst 2.39.3 → 2.39.4

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/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export type { SSTConfig } from "./project.js";
2
+ export { Resource } from "./resource.js";
package/index.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export { Resource } from "./resource.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.39.3",
4
+ "version": "2.39.4",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -121,7 +121,7 @@
121
121
  "@types/ws": "^8.5.3",
122
122
  "@types/yargs": "^17.0.13",
123
123
  "archiver": "^5.3.1",
124
- "astro-sst": "2.39.3",
124
+ "astro-sst": "2.39.4",
125
125
  "async": "^3.2.4",
126
126
  "tsx": "^3.12.1",
127
127
  "typescript": "^5.2.2",
package/resource.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ const SST_LINKS: {
3
+ name: string;
4
+ value: any;
5
+ }[];
6
+ }
7
+ export declare const Resource: {
8
+ [k: string]: any;
9
+ };
package/resource.js ADDED
@@ -0,0 +1,9 @@
1
+ const resources = Object.fromEntries(SST_LINKS.map((item) => [item.name, item.value]));
2
+ export const Resource = new Proxy(resources, {
3
+ get(target, prop) {
4
+ if (!(prop in target)) {
5
+ throw new Error(`"${prop}" is not linked`);
6
+ }
7
+ return target[prop];
8
+ },
9
+ });