@shushed/helpers 0.0.84 → 0.0.86

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +21 -10
  2. package/dist/index.js +136 -109320
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
2
  import { DeepRedact } from '@hackylabs/deep-redact';
3
3
  import { Firestore, DocumentReference } from '@google-cloud/firestore';
4
- import { Logging as Logging$1 } from '@google-cloud/logging';
5
4
  import { PubSub, Topic, Subscription } from '@google-cloud/pubsub';
6
5
  import { Context } from 'co-body';
7
6
  import * as _google_cloud_scheduler_build_protos_protos from '@google-cloud/scheduler/build/protos/protos';
8
7
  import { CloudSchedulerClient } from '@google-cloud/scheduler';
9
8
  import { SecretManagerServiceClient } from '@google-cloud/secret-manager';
10
- import { CloudTasksClient } from '@google-cloud/tasks';
11
9
  import { BigQuery } from '@google-cloud/bigquery';
12
10
 
13
11
  declare const schema$p: {
@@ -29484,7 +29482,6 @@ declare class Logging implements ILogging {
29484
29482
  private workflowId;
29485
29483
  private triggerId;
29486
29484
  private systemEnvName;
29487
- gcpLogging: Logging$1;
29488
29485
  metadata: any;
29489
29486
  logFn: (...args: any[]) => void;
29490
29487
  errorFn: (...args: any[]) => void;
@@ -29733,6 +29730,7 @@ declare class Secrets extends Runtime {
29733
29730
  interface CloudTasksHelperOpts {
29734
29731
  projectId: string;
29735
29732
  serviceAccount: string;
29733
+ accessToken: string;
29736
29734
  envName: string;
29737
29735
  workflowId: string;
29738
29736
  triggerId: string;
@@ -29748,28 +29746,41 @@ interface CreateTaskOpts {
29748
29746
  };
29749
29747
  extraQuery?: Record<string, string>;
29750
29748
  scheduleSeconds?: number;
29751
- repeatCount?: number;
29752
- doNotCreateIfExists?: boolean;
29749
+ doNotCreateIfExists?: string;
29753
29750
  deleteExistingTasks?: boolean;
29751
+ repeatCount?: number;
29752
+ }
29753
+ interface GcpQueue {
29754
+ name: string;
29754
29755
  retryConfig?: {
29755
29756
  maxAttempts?: number;
29756
- maxRetryDuration?: number;
29757
- minBackoff?: number;
29758
- maxBackoff?: number;
29757
+ maxRetryDuration?: string;
29758
+ minBackoff?: string;
29759
+ maxBackoff?: string;
29759
29760
  maxDoublings?: number;
29760
29761
  };
29762
+ rateLimits?: {
29763
+ maxDispatchesPerSecond?: number;
29764
+ maxConcurrentDispatches?: number;
29765
+ };
29761
29766
  }
29762
29767
  declare class CloudTasksHelper extends Runtime {
29763
- private client;
29764
29768
  private projectId;
29765
29769
  private serviceAccount;
29770
+ private accessToken;
29766
29771
  envName: string;
29767
29772
  workflowId: string;
29768
29773
  triggerId: string;
29769
29774
  private location;
29770
- constructor(opts: CloudTasksHelperOpts, cloudTasksClient: CloudTasksClient);
29775
+ constructor(opts: CloudTasksHelperOpts);
29771
29776
  private getQueueName;
29772
29777
  private getQueuePath;
29778
+ private getQueueApiUrl;
29779
+ private getLocationApiUrl;
29780
+ getQueue(topicName: string): Promise<GcpQueue | null>;
29781
+ createOrUpdateQueue(topicName: string, retryConfig?: Required<GcpQueue['retryConfig']>, rateLimits?: Required<GcpQueue['rateLimits']>): Promise<void>;
29782
+ private listTasks;
29783
+ private deleteTask;
29773
29784
  create(opts: CreateTaskOpts): Promise<false | string[]>;
29774
29785
  delete(topicName: string): Promise<boolean>;
29775
29786
  }