@shushed/helpers 0.0.33 → 0.0.35

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/index.d.ts CHANGED
@@ -28762,7 +28762,10 @@ type MessageBody = {
28762
28762
  };
28763
28763
  declare class PubSubHelper extends Runtime {
28764
28764
  private pubSub;
28765
- constructor(opts: Opts, pubSub: PubSub);
28765
+ private serviceAccountEmail;
28766
+ constructor(opts: Opts & {
28767
+ serviceAccountEmail: string;
28768
+ }, pubSub: PubSub);
28766
28769
  static decodeMessageFromRequest(req: Context): Promise<Message>;
28767
28770
  publish(options: Partial<Message> & {
28768
28771
  topicName: string;
package/dist/index.js CHANGED
@@ -685,7 +685,9 @@ var PubSubHelper = class extends Runtime {
685
685
  constructor(opts, pubSub) {
686
686
  super(opts);
687
687
  this.pubSub = pubSub;
688
+ this.serviceAccountEmail = opts.serviceAccountEmail;
688
689
  }
690
+ serviceAccountEmail;
689
691
  static async decodeMessageFromRequest(req) {
690
692
  const rawMessage = await import_co_body.default.json(req);
691
693
  const rawMessageText = Buffer.from(rawMessage.message?.data, "base64").toString("utf-8");
@@ -834,6 +836,7 @@ var PubSubHelper = class extends Runtime {
834
836
  table: opts.tableId,
835
837
  writeMetadata: true,
836
838
  dropUnknownFields: true,
839
+ serviceAccountEmail: this.serviceAccountEmail,
837
840
  useTableSchema: false
838
841
  };
839
842
  } else {
@@ -841,7 +844,7 @@ var PubSubHelper = class extends Runtime {
841
844
  payload.pushConfig = {
842
845
  pushEndpoint: opts.endpointUrl,
843
846
  oidcToken: {
844
- serviceAccountEmail: `runtime@${process.env.GCLOUD_PROJECT}.iam.gserviceaccount.com`,
847
+ serviceAccountEmail: this.serviceAccountEmail,
845
848
  audience: process.env.GCLOUD_PROJECT + "/" + this.triggerId
846
849
  }
847
850
  };
@@ -851,7 +854,7 @@ var PubSubHelper = class extends Runtime {
851
854
  };
852
855
  if (opts.dlqTopic) {
853
856
  payload.deadLetterPolicy = {
854
- deadLetterTopic: opts.dlqTopic.name,
857
+ deadLetterTopic: this.getNameFromFullyQualifiedName(opts.dlqTopic.name),
855
858
  maxDeliveryAttempts: opts.retryLimit
856
859
  };
857
860
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",