@shushed/helpers 0.0.77 → 0.0.79
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 +57 -1
- package/dist/index.js +109398 -18
- package/dist/package.json +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Context } from 'co-body';
|
|
|
7
7
|
import * as _google_cloud_scheduler_build_protos_protos from '@google-cloud/scheduler/build/protos/protos';
|
|
8
8
|
import { CloudSchedulerClient } from '@google-cloud/scheduler';
|
|
9
9
|
import { SecretManagerServiceClient } from '@google-cloud/secret-manager';
|
|
10
|
+
import { CloudTasksClient } from '@google-cloud/tasks';
|
|
10
11
|
import { BigQuery } from '@google-cloud/bigquery';
|
|
11
12
|
|
|
12
13
|
declare const schema$p: {
|
|
@@ -29499,6 +29500,7 @@ declare class Runtime {
|
|
|
29499
29500
|
|
|
29500
29501
|
declare const isPubSubRequest: (headers: Record<string, string>) => boolean;
|
|
29501
29502
|
declare const isCronMessage: (headers: Record<string, string>) => boolean;
|
|
29503
|
+
declare const isCloudTask: (headers: Record<string, string>) => boolean;
|
|
29502
29504
|
declare const validateGoogleAuth: (opts: Opts & {
|
|
29503
29505
|
serviceAccount?: string | null;
|
|
29504
29506
|
}, headers: Record<string, string>, firestore: Firestore) => Promise<void>;
|
|
@@ -29697,6 +29699,13 @@ declare class SchedulerHelper extends Runtime {
|
|
|
29697
29699
|
httpTarget: _google_cloud_scheduler_build_protos_protos.google.cloud.scheduler.v1.IHttpTarget | null | undefined;
|
|
29698
29700
|
pubsubTarget: _google_cloud_scheduler_build_protos_protos.google.cloud.scheduler.v1.IPubsubTarget | null | undefined;
|
|
29699
29701
|
}>;
|
|
29702
|
+
retrieve(): Promise<{
|
|
29703
|
+
state: "STATE_UNSPECIFIED" | _google_cloud_scheduler_build_protos_protos.google.cloud.scheduler.v1.Job.State | "ENABLED" | "PAUSED" | "DISABLED" | "UPDATE_FAILED" | null | undefined;
|
|
29704
|
+
schedule: string | null | undefined;
|
|
29705
|
+
timeZone: string | null | undefined;
|
|
29706
|
+
httpTarget: _google_cloud_scheduler_build_protos_protos.google.cloud.scheduler.v1.IHttpTarget | null | undefined;
|
|
29707
|
+
pubsubTarget: _google_cloud_scheduler_build_protos_protos.google.cloud.scheduler.v1.IPubsubTarget | null | undefined;
|
|
29708
|
+
} | null>;
|
|
29700
29709
|
update({ schedule, timezone, extraQuery }: {
|
|
29701
29710
|
schedule: string;
|
|
29702
29711
|
timezone: string;
|
|
@@ -29717,6 +29726,50 @@ declare class Secrets extends Runtime {
|
|
|
29717
29726
|
getSecret(name: string): Promise<string>;
|
|
29718
29727
|
}
|
|
29719
29728
|
|
|
29729
|
+
interface CloudTasksHelperOpts {
|
|
29730
|
+
projectId: string;
|
|
29731
|
+
serviceAccount: string;
|
|
29732
|
+
envName: string;
|
|
29733
|
+
workflowId: string;
|
|
29734
|
+
triggerId: string;
|
|
29735
|
+
url: string;
|
|
29736
|
+
}
|
|
29737
|
+
interface CreateTaskOpts {
|
|
29738
|
+
topicName: string;
|
|
29739
|
+
httpTarget: {
|
|
29740
|
+
uri?: string;
|
|
29741
|
+
httpMethod?: 'POST' | 'GET' | 'PUT' | 'DELETE';
|
|
29742
|
+
headers?: Record<string, string>;
|
|
29743
|
+
body?: any;
|
|
29744
|
+
};
|
|
29745
|
+
extraQuery?: Record<string, string>;
|
|
29746
|
+
scheduleSeconds?: number;
|
|
29747
|
+
repeatCount?: number;
|
|
29748
|
+
doNotCreateIfExists?: boolean;
|
|
29749
|
+
deleteExistingTasks?: boolean;
|
|
29750
|
+
retryConfig?: {
|
|
29751
|
+
maxAttempts?: number;
|
|
29752
|
+
maxRetryDuration?: number;
|
|
29753
|
+
minBackoff?: number;
|
|
29754
|
+
maxBackoff?: number;
|
|
29755
|
+
maxDoublings?: number;
|
|
29756
|
+
};
|
|
29757
|
+
}
|
|
29758
|
+
declare class CloudTasksHelper extends Runtime {
|
|
29759
|
+
private client;
|
|
29760
|
+
private projectId;
|
|
29761
|
+
private serviceAccount;
|
|
29762
|
+
envName: string;
|
|
29763
|
+
workflowId: string;
|
|
29764
|
+
triggerId: string;
|
|
29765
|
+
private location;
|
|
29766
|
+
constructor(opts: CloudTasksHelperOpts, cloudTasksClient: CloudTasksClient);
|
|
29767
|
+
private getQueueName;
|
|
29768
|
+
private getQueuePath;
|
|
29769
|
+
create(opts: CreateTaskOpts): Promise<false | string[]>;
|
|
29770
|
+
delete(topicName: string): Promise<boolean>;
|
|
29771
|
+
}
|
|
29772
|
+
|
|
29720
29773
|
declare class JWKSHelper extends Runtime {
|
|
29721
29774
|
private firestore;
|
|
29722
29775
|
constructor(opts: Opts, firestore: Firestore);
|
|
@@ -29975,6 +30028,8 @@ type NodeOptions = {
|
|
|
29975
30028
|
|
|
29976
30029
|
type index_BigQueryHelper = BigQueryHelper;
|
|
29977
30030
|
declare const index_BigQueryHelper: typeof BigQueryHelper;
|
|
30031
|
+
type index_CloudTasksHelper = CloudTasksHelper;
|
|
30032
|
+
declare const index_CloudTasksHelper: typeof CloudTasksHelper;
|
|
29978
30033
|
type index_EnvEngine = EnvEngine;
|
|
29979
30034
|
declare const index_EnvEngine: typeof EnvEngine;
|
|
29980
30035
|
type index_ILogging = ILogging;
|
|
@@ -29995,6 +30050,7 @@ declare const index_Secrets: typeof Secrets;
|
|
|
29995
30050
|
type index_TriggerOnCreateOptions = TriggerOnCreateOptions;
|
|
29996
30051
|
type index_TriggerOnExecuteOptions = TriggerOnExecuteOptions;
|
|
29997
30052
|
declare const index_getEventTime: typeof getEventTime;
|
|
30053
|
+
declare const index_isCloudTask: typeof isCloudTask;
|
|
29998
30054
|
declare const index_isCronMessage: typeof isCronMessage;
|
|
29999
30055
|
declare const index_isPubSubRequest: typeof isPubSubRequest;
|
|
30000
30056
|
declare const index_parseDateOrDefault: typeof parseDateOrDefault;
|
|
@@ -30004,7 +30060,7 @@ declare const index_shortHash: typeof shortHash;
|
|
|
30004
30060
|
declare const index_validate: typeof validate;
|
|
30005
30061
|
declare const index_validateGoogleAuth: typeof validateGoogleAuth;
|
|
30006
30062
|
declare namespace index {
|
|
30007
|
-
export { index_BigQueryHelper as BigQueryHelper, index_EnvEngine as EnvEngine, type index_ILogging as ILogging, index_JWKSHelper as JWKSHelper, index_Logging as Logging, type index_Message as Message, type index_NodeOptions as NodeOptions, index_PubSubHelper as PubSubHelper, index_Runtime as Runtime, index_SchedulerHelper as SchedulerHelper, index_Secrets as Secrets, type index_TriggerOnCreateOptions as TriggerOnCreateOptions, type index_TriggerOnExecuteOptions as TriggerOnExecuteOptions, index_getEventTime as getEventTime, index_isCronMessage as isCronMessage, index_isPubSubRequest as isPubSubRequest, index_parseDateOrDefault as parseDateOrDefault, index_sanitize as sanitize, index_sanitizeToString as sanitizeToString, index_shortHash as shortHash, index_validate as validate, index_validateGoogleAuth as validateGoogleAuth };
|
|
30063
|
+
export { index_BigQueryHelper as BigQueryHelper, index_CloudTasksHelper as CloudTasksHelper, index_EnvEngine as EnvEngine, type index_ILogging as ILogging, index_JWKSHelper as JWKSHelper, index_Logging as Logging, type index_Message as Message, type index_NodeOptions as NodeOptions, index_PubSubHelper as PubSubHelper, index_Runtime as Runtime, index_SchedulerHelper as SchedulerHelper, index_Secrets as Secrets, type index_TriggerOnCreateOptions as TriggerOnCreateOptions, type index_TriggerOnExecuteOptions as TriggerOnExecuteOptions, index_getEventTime as getEventTime, index_isCloudTask as isCloudTask, index_isCronMessage as isCronMessage, index_isPubSubRequest as isPubSubRequest, index_parseDateOrDefault as parseDateOrDefault, index_sanitize as sanitize, index_sanitizeToString as sanitizeToString, index_shortHash as shortHash, index_validate as validate, index_validateGoogleAuth as validateGoogleAuth };
|
|
30008
30064
|
}
|
|
30009
30065
|
|
|
30010
30066
|
export { index as lib, index$9 as schema, index$1 as types };
|