sst 3.0.1-35 → 3.0.1-37

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.
@@ -46,8 +46,6 @@ export function AuthHandler(input) {
46
46
  });
47
47
  };
48
48
  }
49
- console.log(process.env.AUTH_PRIVATE_KEY);
50
- console.log(process.env.AUTH_PUBLIC_KEY);
51
49
  const options = {
52
50
  signing: {
53
51
  privateKey: jose.importPKCS8(process.env.AUTH_PRIVATE_KEY, "RS512"),
@@ -1,3 +1,4 @@
1
+ import { Resource } from "./resource.js";
1
2
  export type IngestEvent = {
2
3
  /**
3
4
  * The text used to generate the embedding vector.
@@ -175,7 +176,9 @@ type RetriveResponse = {
175
176
  */
176
177
  score: number;
177
178
  };
178
- export declare const VectorClient: (name: string) => {
179
+ export declare function VectorClient<T extends keyof {
180
+ [key in keyof Resource as "sst.aws.Vector" extends Resource[key]["type"] ? string extends key ? never : key : never]: Resource[key];
181
+ }>(name: T): {
179
182
  ingest: (event: IngestEvent) => Promise<void>;
180
183
  retrieve: (event: RetrieveEvent) => Promise<RetriveResponse>;
181
184
  remove: (event: RemoveEvent) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { LambdaClient, InvokeCommand, } from "@aws-sdk/client-lambda";
2
2
  import { Resource } from "./resource.js";
3
3
  const lambda = new LambdaClient();
4
- export const VectorClient = (name) => {
4
+ export function VectorClient(name) {
5
5
  return {
6
6
  ingest: async (event) => {
7
7
  const ret = await lambda.send(new InvokeCommand({
@@ -25,7 +25,7 @@ export const VectorClient = (name) => {
25
25
  parsePayload(ret, "Failed to remove from the vector db");
26
26
  },
27
27
  };
28
- };
28
+ }
29
29
  function parsePayload(output, message) {
30
30
  const payload = JSON.parse(Buffer.from(output.Payload).toString());
31
31
  // Set cause to the payload so that it can be logged in CloudWatch
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "sst",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
- "version": "3.0.1-35",
6
+ "version": "3.0.1-37",
7
7
  "main": "./dist/index.js",
8
8
  "exports": {
9
9
  ".": "./dist/index.js",