@shushed/helpers 0.0.33 → 0.0.34
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 +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
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
|
-
|
|
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:
|
|
847
|
+
serviceAccountEmail: this.serviceAccountEmail,
|
|
845
848
|
audience: process.env.GCLOUD_PROJECT + "/" + this.triggerId
|
|
846
849
|
}
|
|
847
850
|
};
|