From 05f1c0ec57e074437108914b597344ca8ca068e3 Mon Sep 17 00:00:00 2001 From: Evelyn Tsai Date: Tue, 30 Nov 2021 11:04:18 -0800 Subject: [PATCH 1/2] list all webhook endpoints --- package.json | 5 + src/extension.ts | 8 + src/rpc/commands_grpc_pb.d.ts | 281 +++------- src/rpc/commands_grpc_pb.js | 35 ++ src/rpc/commands_pb.d.ts | 5 +- src/rpc/commands_pb.js | 2 + src/rpc/common_pb.d.ts | 139 ++--- src/rpc/events_resend_pb.d.ts | 133 ++--- src/rpc/fixtures_grpc_pb.d.ts | 1 + src/rpc/fixtures_pb.d.ts | 64 +-- src/rpc/listen_pb.d.ts | 319 +++++------ src/rpc/login_pb.d.ts | 64 +-- src/rpc/login_status_pb.d.ts | 64 +-- src/rpc/logs_tail_pb.d.ts | 400 ++++++------- src/rpc/sample_configs_pb.d.ts | 118 ++-- src/rpc/sample_create_pb.d.ts | 102 ++-- src/rpc/samples_list_pb.d.ts | 105 ++-- src/rpc/trigger_pb.d.ts | 122 ++-- src/rpc/triggers_list_pb.d.ts | 61 +- src/rpc/version_pb.d.ts | 57 +- src/rpc/webhook_endpoints_list_grpc_pb.d.ts | 1 + src/rpc/webhook_endpoints_list_grpc_pb.js | 1 + src/rpc/webhook_endpoints_list_pb.d.ts | 77 +++ src/rpc/webhook_endpoints_list_pb.js | 591 ++++++++++++++++++++ src/stripeWebhooksView.ts | 86 +++ test/suite/commands.test.ts | 6 +- test/suite/stripeWebhooksView.test.ts | 96 ++++ 27 files changed, 1861 insertions(+), 1082 deletions(-) create mode 100644 src/rpc/fixtures_grpc_pb.d.ts create mode 100644 src/rpc/webhook_endpoints_list_grpc_pb.d.ts create mode 100644 src/rpc/webhook_endpoints_list_grpc_pb.js create mode 100644 src/rpc/webhook_endpoints_list_pb.d.ts create mode 100644 src/rpc/webhook_endpoints_list_pb.js create mode 100644 src/stripeWebhooksView.ts create mode 100644 test/suite/stripeWebhooksView.test.ts diff --git a/package.json b/package.json index dc553695..d31f10e2 100644 --- a/package.json +++ b/package.json @@ -282,6 +282,11 @@ "name": "Logs", "when": "stripe.isNotCLIInstalled == false" }, + { + "id": "stripeWebhooksView", + "name": "Webhooks", + "when": "stripe.isNotCLIInstalled == false" + }, { "id": "stripeSamplesView", "name": "Samples", diff --git a/src/extension.ts b/src/extension.ts index c2264330..d0bfd770 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -32,6 +32,7 @@ import {StripeResourceDocumentContentProvider} from './stripeResourceDocumentCon import {StripeSamples} from './stripeSamples'; import {StripeSamplesViewProvider} from './stripeSamplesView'; import {StripeTerminal} from './stripeTerminal'; +import {StripeWebhooksViewProvider} from './stripeWebhooksView'; import {SurveyPrompt} from './surveyPrompt'; import {TelemetryPrompt} from './telemetryPrompt'; import path from 'path'; @@ -68,6 +69,13 @@ export function activate(this: any, context: ExtensionContext) { showCollapseAll: true, }); + const stripeWebhooksViewProvider = new StripeWebhooksViewProvider(stripeDaemon); + window.createTreeView('stripeWebhooksView', { + treeDataProvider: stripeWebhooksViewProvider, + showCollapseAll: true, + }); + stripeWebhooksViewProvider.refreshEndpoints(); + window.createTreeView('stripeSamplesView', { treeDataProvider: new StripeSamplesViewProvider(), showCollapseAll: false, diff --git a/src/rpc/commands_grpc_pb.d.ts b/src/rpc/commands_grpc_pb.d.ts index e0bb82ba..7f94a156 100644 --- a/src/rpc/commands_grpc_pb.d.ts +++ b/src/rpc/commands_grpc_pb.d.ts @@ -1,10 +1,8 @@ +// GENERATED CODE -- DO NOT EDIT! + // package: rpc // file: commands.proto -/* tslint:disable */ -/* eslint-disable */ - -import * as grpc from "@grpc/grpc-js"; import * as commands_pb from "./commands_pb"; import * as events_resend_pb from "./events_resend_pb"; import * as fixtures_pb from "./fixtures_pb"; @@ -18,219 +16,80 @@ import * as samples_list_pb from "./samples_list_pb"; import * as trigger_pb from "./trigger_pb"; import * as triggers_list_pb from "./triggers_list_pb"; import * as version_pb from "./version_pb"; +import * as webhook_endpoints_list_pb from "./webhook_endpoints_list_pb"; +import * as grpc from "@grpc/grpc-js"; interface IStripeCLIService extends grpc.ServiceDefinition { - eventsResend: IStripeCLIService_IEventsResend; - fixture: IStripeCLIService_IFixture; - listen: IStripeCLIService_IListen; - login: IStripeCLIService_ILogin; - loginStatus: IStripeCLIService_ILoginStatus; - logsTail: IStripeCLIService_ILogsTail; - sampleConfigs: IStripeCLIService_ISampleConfigs; - sampleCreate: IStripeCLIService_ISampleCreate; - samplesList: IStripeCLIService_ISamplesList; - trigger: IStripeCLIService_ITrigger; - triggersList: IStripeCLIService_ITriggersList; - version: IStripeCLIService_IVersion; -} - -interface IStripeCLIService_IEventsResend extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/EventsResend"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_IFixture extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/Fixture"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_IListen extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/Listen"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ILogin extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/Login"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ILoginStatus extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/LoginStatus"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ILogsTail extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/LogsTail"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ISampleConfigs extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/SampleConfigs"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ISampleCreate extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/SampleCreate"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ISamplesList extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/SamplesList"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ITrigger extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/Trigger"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_ITriggersList extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/TriggersList"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IStripeCLIService_IVersion extends grpc.MethodDefinition { - path: "/rpc.StripeCLI/Version"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; + eventsResend: grpc.MethodDefinition; + fixture: grpc.MethodDefinition; + listen: grpc.MethodDefinition; + login: grpc.MethodDefinition; + loginStatus: grpc.MethodDefinition; + logsTail: grpc.MethodDefinition; + sampleConfigs: grpc.MethodDefinition; + sampleCreate: grpc.MethodDefinition; + samplesList: grpc.MethodDefinition; + trigger: grpc.MethodDefinition; + triggersList: grpc.MethodDefinition; + version: grpc.MethodDefinition; + webhookEndpointsList: grpc.MethodDefinition; } export const StripeCLIService: IStripeCLIService; -export interface IStripeCLIServer { - eventsResend: grpc.handleUnaryCall; - fixture: grpc.handleUnaryCall; - listen: grpc.handleServerStreamingCall; - login: grpc.handleUnaryCall; - loginStatus: grpc.handleUnaryCall; - logsTail: grpc.handleServerStreamingCall; - sampleConfigs: grpc.handleUnaryCall; - sampleCreate: grpc.handleUnaryCall; - samplesList: grpc.handleUnaryCall; - trigger: grpc.handleUnaryCall; - triggersList: grpc.handleUnaryCall; - version: grpc.handleUnaryCall; -} - -export interface IStripeCLIClient { - eventsResend(request: events_resend_pb.EventsResendRequest, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - eventsResend(request: events_resend_pb.EventsResendRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - eventsResend(request: events_resend_pb.EventsResendRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - fixture(request: fixtures_pb.FixtureRequest, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - fixture(request: fixtures_pb.FixtureRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - fixture(request: fixtures_pb.FixtureRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - listen(request: listen_pb.ListenRequest, options?: Partial): grpc.ClientReadableStream; - listen(request: listen_pb.ListenRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - login(request: login_pb.LoginRequest, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - login(request: login_pb.LoginRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - login(request: login_pb.LoginRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - loginStatus(request: login_status_pb.LoginStatusRequest, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - loginStatus(request: login_status_pb.LoginStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - loginStatus(request: login_status_pb.LoginStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - logsTail(request: logs_tail_pb.LogsTailRequest, options?: Partial): grpc.ClientReadableStream; - logsTail(request: logs_tail_pb.LogsTailRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - sampleCreate(request: sample_create_pb.SampleCreateRequest, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - sampleCreate(request: sample_create_pb.SampleCreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - sampleCreate(request: sample_create_pb.SampleCreateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - samplesList(request: samples_list_pb.SamplesListRequest, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - samplesList(request: samples_list_pb.SamplesListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - samplesList(request: samples_list_pb.SamplesListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - trigger(request: trigger_pb.TriggerRequest, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - trigger(request: trigger_pb.TriggerRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - trigger(request: trigger_pb.TriggerRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - triggersList(request: triggers_list_pb.TriggersListRequest, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - triggersList(request: triggers_list_pb.TriggersListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - triggersList(request: triggers_list_pb.TriggersListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - version(request: version_pb.VersionRequest, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; - version(request: version_pb.VersionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; - version(request: version_pb.VersionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; +export interface IStripeCLIServer extends grpc.UntypedServiceImplementation { + eventsResend: grpc.handleUnaryCall; + fixture: grpc.handleUnaryCall; + listen: grpc.handleServerStreamingCall; + login: grpc.handleUnaryCall; + loginStatus: grpc.handleUnaryCall; + logsTail: grpc.handleServerStreamingCall; + sampleConfigs: grpc.handleUnaryCall; + sampleCreate: grpc.handleUnaryCall; + samplesList: grpc.handleUnaryCall; + trigger: grpc.handleUnaryCall; + triggersList: grpc.handleUnaryCall; + version: grpc.handleUnaryCall; + webhookEndpointsList: grpc.handleUnaryCall; } -export class StripeCLIClient extends grpc.Client implements IStripeCLIClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - public eventsResend(request: events_resend_pb.EventsResendRequest, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - public eventsResend(request: events_resend_pb.EventsResendRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - public eventsResend(request: events_resend_pb.EventsResendRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: events_resend_pb.EventsResendResponse) => void): grpc.ClientUnaryCall; - public fixture(request: fixtures_pb.FixtureRequest, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - public fixture(request: fixtures_pb.FixtureRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - public fixture(request: fixtures_pb.FixtureRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: fixtures_pb.FixtureResponse) => void): grpc.ClientUnaryCall; - public listen(request: listen_pb.ListenRequest, options?: Partial): grpc.ClientReadableStream; - public listen(request: listen_pb.ListenRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public login(request: login_pb.LoginRequest, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - public login(request: login_pb.LoginRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - public login(request: login_pb.LoginRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: login_pb.LoginResponse) => void): grpc.ClientUnaryCall; - public loginStatus(request: login_status_pb.LoginStatusRequest, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - public loginStatus(request: login_status_pb.LoginStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - public loginStatus(request: login_status_pb.LoginStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: login_status_pb.LoginStatusResponse) => void): grpc.ClientUnaryCall; - public logsTail(request: logs_tail_pb.LogsTailRequest, options?: Partial): grpc.ClientReadableStream; - public logsTail(request: logs_tail_pb.LogsTailRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - public sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - public sampleConfigs(request: sample_configs_pb.SampleConfigsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: sample_configs_pb.SampleConfigsResponse) => void): grpc.ClientUnaryCall; - public sampleCreate(request: sample_create_pb.SampleCreateRequest, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - public sampleCreate(request: sample_create_pb.SampleCreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - public sampleCreate(request: sample_create_pb.SampleCreateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: sample_create_pb.SampleCreateResponse) => void): grpc.ClientUnaryCall; - public samplesList(request: samples_list_pb.SamplesListRequest, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - public samplesList(request: samples_list_pb.SamplesListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - public samplesList(request: samples_list_pb.SamplesListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: samples_list_pb.SamplesListResponse) => void): grpc.ClientUnaryCall; - public trigger(request: trigger_pb.TriggerRequest, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - public trigger(request: trigger_pb.TriggerRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - public trigger(request: trigger_pb.TriggerRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: trigger_pb.TriggerResponse) => void): grpc.ClientUnaryCall; - public triggersList(request: triggers_list_pb.TriggersListRequest, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - public triggersList(request: triggers_list_pb.TriggersListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - public triggersList(request: triggers_list_pb.TriggersListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: triggers_list_pb.TriggersListResponse) => void): grpc.ClientUnaryCall; - public version(request: version_pb.VersionRequest, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; - public version(request: version_pb.VersionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; - public version(request: version_pb.VersionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: version_pb.VersionResponse) => void): grpc.ClientUnaryCall; +export class StripeCLIClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + eventsResend(argument: events_resend_pb.EventsResendRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + eventsResend(argument: events_resend_pb.EventsResendRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + eventsResend(argument: events_resend_pb.EventsResendRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + fixture(argument: fixtures_pb.FixtureRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + fixture(argument: fixtures_pb.FixtureRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + fixture(argument: fixtures_pb.FixtureRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + listen(argument: listen_pb.ListenRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; + listen(argument: listen_pb.ListenRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; + login(argument: login_pb.LoginRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + login(argument: login_pb.LoginRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + login(argument: login_pb.LoginRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + loginStatus(argument: login_status_pb.LoginStatusRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + loginStatus(argument: login_status_pb.LoginStatusRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + loginStatus(argument: login_status_pb.LoginStatusRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + logsTail(argument: logs_tail_pb.LogsTailRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; + logsTail(argument: logs_tail_pb.LogsTailRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; + sampleConfigs(argument: sample_configs_pb.SampleConfigsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sampleConfigs(argument: sample_configs_pb.SampleConfigsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sampleConfigs(argument: sample_configs_pb.SampleConfigsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sampleCreate(argument: sample_create_pb.SampleCreateRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sampleCreate(argument: sample_create_pb.SampleCreateRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sampleCreate(argument: sample_create_pb.SampleCreateRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + samplesList(argument: samples_list_pb.SamplesListRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + samplesList(argument: samples_list_pb.SamplesListRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + samplesList(argument: samples_list_pb.SamplesListRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + trigger(argument: trigger_pb.TriggerRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + trigger(argument: trigger_pb.TriggerRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + trigger(argument: trigger_pb.TriggerRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + triggersList(argument: triggers_list_pb.TriggersListRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + triggersList(argument: triggers_list_pb.TriggersListRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + triggersList(argument: triggers_list_pb.TriggersListRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + version(argument: version_pb.VersionRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + version(argument: version_pb.VersionRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + version(argument: version_pb.VersionRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + webhookEndpointsList(argument: webhook_endpoints_list_pb.WebhookEndpointsListRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + webhookEndpointsList(argument: webhook_endpoints_list_pb.WebhookEndpointsListRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + webhookEndpointsList(argument: webhook_endpoints_list_pb.WebhookEndpointsListRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; } diff --git a/src/rpc/commands_grpc_pb.js b/src/rpc/commands_grpc_pb.js index 7642b26f..2593151a 100644 --- a/src/rpc/commands_grpc_pb.js +++ b/src/rpc/commands_grpc_pb.js @@ -14,6 +14,7 @@ var samples_list_pb = require('./samples_list_pb.js'); var trigger_pb = require('./trigger_pb.js'); var triggers_list_pb = require('./triggers_list_pb.js'); var version_pb = require('./version_pb.js'); +var webhook_endpoints_list_pb = require('./webhook_endpoints_list_pb.js'); function serialize_rpc_EventsResendRequest(arg) { if (!(arg instanceof events_resend_pb.EventsResendRequest)) { @@ -279,6 +280,28 @@ function deserialize_rpc_VersionResponse(buffer_arg) { return version_pb.VersionResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_rpc_WebhookEndpointsListRequest(arg) { + if (!(arg instanceof webhook_endpoints_list_pb.WebhookEndpointsListRequest)) { + throw new Error('Expected argument of type rpc.WebhookEndpointsListRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_rpc_WebhookEndpointsListRequest(buffer_arg) { + return webhook_endpoints_list_pb.WebhookEndpointsListRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_rpc_WebhookEndpointsListResponse(arg) { + if (!(arg instanceof webhook_endpoints_list_pb.WebhookEndpointsListResponse)) { + throw new Error('Expected argument of type rpc.WebhookEndpointsListResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_rpc_WebhookEndpointsListResponse(buffer_arg) { + return webhook_endpoints_list_pb.WebhookEndpointsListResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + var StripeCLIService = exports.StripeCLIService = { // Resend an event given an event ID. Like `stripe events resend`. @@ -427,6 +450,18 @@ version: { responseSerialize: serialize_rpc_VersionResponse, responseDeserialize: deserialize_rpc_VersionResponse, }, + // Get the list of webhook endpoints. +webhookEndpointsList: { + path: '/rpc.StripeCLI/WebhookEndpointsList', + requestStream: false, + responseStream: false, + requestType: webhook_endpoints_list_pb.WebhookEndpointsListRequest, + responseType: webhook_endpoints_list_pb.WebhookEndpointsListResponse, + requestSerialize: serialize_rpc_WebhookEndpointsListRequest, + requestDeserialize: deserialize_rpc_WebhookEndpointsListRequest, + responseSerialize: serialize_rpc_WebhookEndpointsListResponse, + responseDeserialize: deserialize_rpc_WebhookEndpointsListResponse, + }, }; exports.StripeCLIClient = grpc.makeGenericClientConstructor(StripeCLIService); diff --git a/src/rpc/commands_pb.d.ts b/src/rpc/commands_pb.d.ts index 5fb8799d..11e93d5b 100644 --- a/src/rpc/commands_pb.d.ts +++ b/src/rpc/commands_pb.d.ts @@ -1,9 +1,6 @@ // package: rpc // file: commands.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; import * as events_resend_pb from "./events_resend_pb"; import * as fixtures_pb from "./fixtures_pb"; @@ -17,3 +14,5 @@ import * as samples_list_pb from "./samples_list_pb"; import * as trigger_pb from "./trigger_pb"; import * as triggers_list_pb from "./triggers_list_pb"; import * as version_pb from "./version_pb"; +import * as webhook_endpoints_list_pb from "./webhook_endpoints_list_pb"; + diff --git a/src/rpc/commands_pb.js b/src/rpc/commands_pb.js index 14c18705..9cb52b0e 100644 --- a/src/rpc/commands_pb.js +++ b/src/rpc/commands_pb.js @@ -39,3 +39,5 @@ var triggers_list_pb = require('./triggers_list_pb.js'); goog.object.extend(proto, triggers_list_pb); var version_pb = require('./version_pb.js'); goog.object.extend(proto, version_pb); +var webhook_endpoints_list_pb = require('./webhook_endpoints_list_pb.js'); +goog.object.extend(proto, webhook_endpoints_list_pb); diff --git a/src/rpc/common_pb.d.ts b/src/rpc/common_pb.d.ts index bc26ade8..9db25f7b 100644 --- a/src/rpc/common_pb.d.ts +++ b/src/rpc/common_pb.d.ts @@ -1,83 +1,86 @@ // package: rpc // file: common.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; -export class StripeEvent extends jspb.Message { - getId(): string; - setId(value: string): StripeEvent; - getApiVersion(): string; - setApiVersion(value: string): StripeEvent; - - hasData(): boolean; - clearData(): void; - getData(): google_protobuf_struct_pb.Struct | undefined; - setData(value?: google_protobuf_struct_pb.Struct): StripeEvent; - - hasRequest(): boolean; - clearRequest(): void; - getRequest(): StripeEvent.Request | undefined; - setRequest(value?: StripeEvent.Request): StripeEvent; - getType(): string; - setType(value: string): StripeEvent; - getAccount(): string; - setAccount(value: string): StripeEvent; - getCreated(): number; - setCreated(value: number): StripeEvent; - getLivemode(): boolean; - setLivemode(value: boolean): StripeEvent; - getPendingWebhooks(): number; - setPendingWebhooks(value: number): StripeEvent; +export class StripeEvent extends jspb.Message { + getId(): string; + setId(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StripeEvent.AsObject; - static toObject(includeInstance: boolean, msg: StripeEvent): StripeEvent.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StripeEvent, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StripeEvent; - static deserializeBinaryFromReader(message: StripeEvent, reader: jspb.BinaryReader): StripeEvent; + getApiVersion(): string; + setApiVersion(value: string): void; + + hasData(): boolean; + clearData(): void; + getData(): google_protobuf_struct_pb.Struct | undefined; + setData(value?: google_protobuf_struct_pb.Struct): void; + + hasRequest(): boolean; + clearRequest(): void; + getRequest(): StripeEvent.Request | undefined; + setRequest(value?: StripeEvent.Request): void; + + getType(): string; + setType(value: string): void; + + getAccount(): string; + setAccount(value: string): void; + + getCreated(): number; + setCreated(value: number): void; + + getLivemode(): boolean; + setLivemode(value: boolean): void; + + getPendingWebhooks(): number; + setPendingWebhooks(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StripeEvent.AsObject; + static toObject(includeInstance: boolean, msg: StripeEvent): StripeEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StripeEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StripeEvent; + static deserializeBinaryFromReader(message: StripeEvent, reader: jspb.BinaryReader): StripeEvent; } export namespace StripeEvent { - export type AsObject = { - id: string, - apiVersion: string, - data?: google_protobuf_struct_pb.Struct.AsObject, - request?: StripeEvent.Request.AsObject, - type: string, - account: string, - created: number, - livemode: boolean, - pendingWebhooks: number, - } + export type AsObject = { + id: string, + apiVersion: string, + data?: google_protobuf_struct_pb.Struct.AsObject, + request?: StripeEvent.Request.AsObject, + type: string, + account: string, + created: number, + livemode: boolean, + pendingWebhooks: number, + } + export class Request extends jspb.Message { + getId(): string; + setId(value: string): void; - export class Request extends jspb.Message { - getId(): string; - setId(value: string): Request; - getIdempotencyKey(): string; - setIdempotencyKey(value: string): Request; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Request.AsObject; - static toObject(includeInstance: boolean, msg: Request): Request.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Request, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Request; - static deserializeBinaryFromReader(message: Request, reader: jspb.BinaryReader): Request; - } + getIdempotencyKey(): string; + setIdempotencyKey(value: string): void; - export namespace Request { - export type AsObject = { - id: string, - idempotencyKey: string, - } - } + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Request.AsObject; + static toObject(includeInstance: boolean, msg: Request): Request.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Request, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Request; + static deserializeBinaryFromReader(message: Request, reader: jspb.BinaryReader): Request; + } + export namespace Request { + export type AsObject = { + id: string, + idempotencyKey: string, + } + } } + diff --git a/src/rpc/events_resend_pb.d.ts b/src/rpc/events_resend_pb.d.ts index a0d9806b..00a44829 100644 --- a/src/rpc/events_resend_pb.d.ts +++ b/src/rpc/events_resend_pb.d.ts @@ -1,79 +1,84 @@ // package: rpc // file: events_resend.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; import * as common_pb from "./common_pb"; -export class EventsResendRequest extends jspb.Message { - getEventId(): string; - setEventId(value: string): EventsResendRequest; - getAccount(): string; - setAccount(value: string): EventsResendRequest; - clearDataList(): void; - getDataList(): Array; - setDataList(value: Array): EventsResendRequest; - addData(value: string, index?: number): string; - clearExpandList(): void; - getExpandList(): Array; - setExpandList(value: Array): EventsResendRequest; - addExpand(value: string, index?: number): string; - getIdempotency(): string; - setIdempotency(value: string): EventsResendRequest; - getLive(): boolean; - setLive(value: boolean): EventsResendRequest; - getStripeAccount(): string; - setStripeAccount(value: string): EventsResendRequest; - getVersion(): string; - setVersion(value: string): EventsResendRequest; - getWebhookEndpoint(): string; - setWebhookEndpoint(value: string): EventsResendRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EventsResendRequest.AsObject; - static toObject(includeInstance: boolean, msg: EventsResendRequest): EventsResendRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EventsResendRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EventsResendRequest; - static deserializeBinaryFromReader(message: EventsResendRequest, reader: jspb.BinaryReader): EventsResendRequest; +export class EventsResendRequest extends jspb.Message { + getEventId(): string; + setEventId(value: string): void; + + getAccount(): string; + setAccount(value: string): void; + + clearDataList(): void; + getDataList(): Array; + setDataList(value: Array): void; + addData(value: string, index?: number): string; + + clearExpandList(): void; + getExpandList(): Array; + setExpandList(value: Array): void; + addExpand(value: string, index?: number): string; + + getIdempotency(): string; + setIdempotency(value: string): void; + + getLive(): boolean; + setLive(value: boolean): void; + + getStripeAccount(): string; + setStripeAccount(value: string): void; + + getVersion(): string; + setVersion(value: string): void; + + getWebhookEndpoint(): string; + setWebhookEndpoint(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventsResendRequest.AsObject; + static toObject(includeInstance: boolean, msg: EventsResendRequest): EventsResendRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventsResendRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventsResendRequest; + static deserializeBinaryFromReader(message: EventsResendRequest, reader: jspb.BinaryReader): EventsResendRequest; } export namespace EventsResendRequest { - export type AsObject = { - eventId: string, - account: string, - dataList: Array, - expandList: Array, - idempotency: string, - live: boolean, - stripeAccount: string, - version: string, - webhookEndpoint: string, - } + export type AsObject = { + eventId: string, + account: string, + dataList: Array, + expandList: Array, + idempotency: string, + live: boolean, + stripeAccount: string, + version: string, + webhookEndpoint: string, + } } -export class EventsResendResponse extends jspb.Message { - - hasStripeEvent(): boolean; - clearStripeEvent(): void; - getStripeEvent(): common_pb.StripeEvent | undefined; - setStripeEvent(value?: common_pb.StripeEvent): EventsResendResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EventsResendResponse.AsObject; - static toObject(includeInstance: boolean, msg: EventsResendResponse): EventsResendResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EventsResendResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EventsResendResponse; - static deserializeBinaryFromReader(message: EventsResendResponse, reader: jspb.BinaryReader): EventsResendResponse; +export class EventsResendResponse extends jspb.Message { + hasStripeEvent(): boolean; + clearStripeEvent(): void; + getStripeEvent(): common_pb.StripeEvent | undefined; + setStripeEvent(value?: common_pb.StripeEvent): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventsResendResponse.AsObject; + static toObject(includeInstance: boolean, msg: EventsResendResponse): EventsResendResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventsResendResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventsResendResponse; + static deserializeBinaryFromReader(message: EventsResendResponse, reader: jspb.BinaryReader): EventsResendResponse; } export namespace EventsResendResponse { - export type AsObject = { - stripeEvent?: common_pb.StripeEvent.AsObject, - } + export type AsObject = { + stripeEvent?: common_pb.StripeEvent.AsObject, + } } + diff --git a/src/rpc/fixtures_grpc_pb.d.ts b/src/rpc/fixtures_grpc_pb.d.ts new file mode 100644 index 00000000..51b4d695 --- /dev/null +++ b/src/rpc/fixtures_grpc_pb.d.ts @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO diff --git a/src/rpc/fixtures_pb.d.ts b/src/rpc/fixtures_pb.d.ts index 942ad714..c83659a6 100644 --- a/src/rpc/fixtures_pb.d.ts +++ b/src/rpc/fixtures_pb.d.ts @@ -1,47 +1,45 @@ // package: rpc // file: fixtures.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class FixtureRequest extends jspb.Message { - getEvent(): string; - setEvent(value: string): FixtureRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FixtureRequest.AsObject; - static toObject(includeInstance: boolean, msg: FixtureRequest): FixtureRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FixtureRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FixtureRequest; - static deserializeBinaryFromReader(message: FixtureRequest, reader: jspb.BinaryReader): FixtureRequest; +export class FixtureRequest extends jspb.Message { + getEvent(): string; + setEvent(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FixtureRequest.AsObject; + static toObject(includeInstance: boolean, msg: FixtureRequest): FixtureRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FixtureRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FixtureRequest; + static deserializeBinaryFromReader(message: FixtureRequest, reader: jspb.BinaryReader): FixtureRequest; } export namespace FixtureRequest { - export type AsObject = { - event: string, - } + export type AsObject = { + event: string, + } } -export class FixtureResponse extends jspb.Message { - getFixture(): string; - setFixture(value: string): FixtureResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FixtureResponse.AsObject; - static toObject(includeInstance: boolean, msg: FixtureResponse): FixtureResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FixtureResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FixtureResponse; - static deserializeBinaryFromReader(message: FixtureResponse, reader: jspb.BinaryReader): FixtureResponse; +export class FixtureResponse extends jspb.Message { + getFixture(): string; + setFixture(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FixtureResponse.AsObject; + static toObject(includeInstance: boolean, msg: FixtureResponse): FixtureResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FixtureResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FixtureResponse; + static deserializeBinaryFromReader(message: FixtureResponse, reader: jspb.BinaryReader): FixtureResponse; } export namespace FixtureResponse { - export type AsObject = { - fixture: string, - } + export type AsObject = { + fixture: string, + } } + diff --git a/src/rpc/listen_pb.d.ts b/src/rpc/listen_pb.d.ts index d18c9165..9a478145 100644 --- a/src/rpc/listen_pb.d.ts +++ b/src/rpc/listen_pb.d.ts @@ -1,191 +1,192 @@ // package: rpc // file: listen.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; import * as common_pb from "./common_pb"; -export class ListenRequest extends jspb.Message { - clearConnectHeadersList(): void; - getConnectHeadersList(): Array; - setConnectHeadersList(value: Array): ListenRequest; - addConnectHeaders(value: string, index?: number): string; - clearEventsList(): void; - getEventsList(): Array; - setEventsList(value: Array): ListenRequest; - addEvents(value: string, index?: number): string; - getForwardConnectTo(): string; - setForwardConnectTo(value: string): ListenRequest; - getForwardTo(): string; - setForwardTo(value: string): ListenRequest; - clearHeadersList(): void; - getHeadersList(): Array; - setHeadersList(value: Array): ListenRequest; - addHeaders(value: string, index?: number): string; - getLatest(): boolean; - setLatest(value: boolean): ListenRequest; - getLive(): boolean; - setLive(value: boolean): ListenRequest; - getSkipVerify(): boolean; - setSkipVerify(value: boolean): ListenRequest; - getUseConfiguredWebhooks(): boolean; - setUseConfiguredWebhooks(value: boolean): ListenRequest; +export class ListenRequest extends jspb.Message { + clearConnectHeadersList(): void; + getConnectHeadersList(): Array; + setConnectHeadersList(value: Array): void; + addConnectHeaders(value: string, index?: number): string; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ListenRequest.AsObject; - static toObject(includeInstance: boolean, msg: ListenRequest): ListenRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ListenRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ListenRequest; - static deserializeBinaryFromReader(message: ListenRequest, reader: jspb.BinaryReader): ListenRequest; -} + clearEventsList(): void; + getEventsList(): Array; + setEventsList(value: Array): void; + addEvents(value: string, index?: number): string; -export namespace ListenRequest { - export type AsObject = { - connectHeadersList: Array, - eventsList: Array, - forwardConnectTo: string, - forwardTo: string, - headersList: Array, - latest: boolean, - live: boolean, - skipVerify: boolean, - useConfiguredWebhooks: boolean, - } -} + getForwardConnectTo(): string; + setForwardConnectTo(value: string): void; + + getForwardTo(): string; + setForwardTo(value: string): void; + + clearHeadersList(): void; + getHeadersList(): Array; + setHeadersList(value: Array): void; + addHeaders(value: string, index?: number): string; -export class ListenResponse extends jspb.Message { + getLatest(): boolean; + setLatest(value: boolean): void; - hasState(): boolean; - clearState(): void; - getState(): ListenResponse.State; - setState(value: ListenResponse.State): ListenResponse; + getLive(): boolean; + setLive(value: boolean): void; - hasStripeEvent(): boolean; - clearStripeEvent(): void; - getStripeEvent(): common_pb.StripeEvent | undefined; - setStripeEvent(value?: common_pb.StripeEvent): ListenResponse; + getSkipVerify(): boolean; + setSkipVerify(value: boolean): void; + + getUseConfiguredWebhooks(): boolean; + setUseConfiguredWebhooks(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListenRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListenRequest): ListenRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListenRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListenRequest; + static deserializeBinaryFromReader(message: ListenRequest, reader: jspb.BinaryReader): ListenRequest; +} - hasEndpointResponse(): boolean; - clearEndpointResponse(): void; - getEndpointResponse(): ListenResponse.EndpointResponse | undefined; - setEndpointResponse(value?: ListenResponse.EndpointResponse): ListenResponse; +export namespace ListenRequest { + export type AsObject = { + connectHeadersList: Array, + eventsList: Array, + forwardConnectTo: string, + forwardTo: string, + headersList: Array, + latest: boolean, + live: boolean, + skipVerify: boolean, + useConfiguredWebhooks: boolean, + } +} - getContentCase(): ListenResponse.ContentCase; +export class ListenResponse extends jspb.Message { + hasState(): boolean; + clearState(): void; + getState(): ListenResponse.StateMap[keyof ListenResponse.StateMap]; + setState(value: ListenResponse.StateMap[keyof ListenResponse.StateMap]): void; + + hasStripeEvent(): boolean; + clearStripeEvent(): void; + getStripeEvent(): common_pb.StripeEvent | undefined; + setStripeEvent(value?: common_pb.StripeEvent): void; + + hasEndpointResponse(): boolean; + clearEndpointResponse(): void; + getEndpointResponse(): ListenResponse.EndpointResponse | undefined; + setEndpointResponse(value?: ListenResponse.EndpointResponse): void; + + getContentCase(): ListenResponse.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListenResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListenResponse): ListenResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListenResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListenResponse; + static deserializeBinaryFromReader(message: ListenResponse, reader: jspb.BinaryReader): ListenResponse; +} +export namespace ListenResponse { + export type AsObject = { + state: ListenResponse.StateMap[keyof ListenResponse.StateMap], + stripeEvent?: common_pb.StripeEvent.AsObject, + endpointResponse?: ListenResponse.EndpointResponse.AsObject, + } + + export class EndpointResponse extends jspb.Message { + hasData(): boolean; + clearData(): void; + getData(): ListenResponse.EndpointResponse.Data | undefined; + setData(value?: ListenResponse.EndpointResponse.Data): void; + + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): void; + + getContentCase(): EndpointResponse.ContentCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ListenResponse.AsObject; - static toObject(includeInstance: boolean, msg: ListenResponse): ListenResponse.AsObject; + toObject(includeInstance?: boolean): EndpointResponse.AsObject; + static toObject(includeInstance: boolean, msg: EndpointResponse): EndpointResponse.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ListenResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ListenResponse; - static deserializeBinaryFromReader(message: ListenResponse, reader: jspb.BinaryReader): ListenResponse; -} + static serializeBinaryToWriter(message: EndpointResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EndpointResponse; + static deserializeBinaryFromReader(message: EndpointResponse, reader: jspb.BinaryReader): EndpointResponse; + } -export namespace ListenResponse { + export namespace EndpointResponse { export type AsObject = { - state: ListenResponse.State, - stripeEvent?: common_pb.StripeEvent.AsObject, - endpointResponse?: ListenResponse.EndpointResponse.AsObject, + data?: ListenResponse.EndpointResponse.Data.AsObject, + error: string, } + export class Data extends jspb.Message { + getStatus(): number; + setStatus(value: number): void; - export class EndpointResponse extends jspb.Message { - - hasData(): boolean; - clearData(): void; - getData(): ListenResponse.EndpointResponse.Data | undefined; - setData(value?: ListenResponse.EndpointResponse.Data): EndpointResponse; + getHttpMethod(): ListenResponse.EndpointResponse.Data.HttpMethodMap[keyof ListenResponse.EndpointResponse.Data.HttpMethodMap]; + setHttpMethod(value: ListenResponse.EndpointResponse.Data.HttpMethodMap[keyof ListenResponse.EndpointResponse.Data.HttpMethodMap]): void; - hasError(): boolean; - clearError(): void; - getError(): string; - setError(value: string): EndpointResponse; + getUrl(): string; + setUrl(value: string): void; - getContentCase(): EndpointResponse.ContentCase; + getEventId(): string; + setEventId(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EndpointResponse.AsObject; - static toObject(includeInstance: boolean, msg: EndpointResponse): EndpointResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EndpointResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EndpointResponse; - static deserializeBinaryFromReader(message: EndpointResponse, reader: jspb.BinaryReader): EndpointResponse; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Data.AsObject; + static toObject(includeInstance: boolean, msg: Data): Data.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Data, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Data; + static deserializeBinaryFromReader(message: Data, reader: jspb.BinaryReader): Data; } - export namespace EndpointResponse { - export type AsObject = { - data?: ListenResponse.EndpointResponse.Data.AsObject, - error: string, - } - - - export class Data extends jspb.Message { - getStatus(): number; - setStatus(value: number): Data; - getHttpMethod(): ListenResponse.EndpointResponse.Data.HttpMethod; - setHttpMethod(value: ListenResponse.EndpointResponse.Data.HttpMethod): Data; - getUrl(): string; - setUrl(value: string): Data; - getEventId(): string; - setEventId(value: string): Data; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Data.AsObject; - static toObject(includeInstance: boolean, msg: Data): Data.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Data, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Data; - static deserializeBinaryFromReader(message: Data, reader: jspb.BinaryReader): Data; - } - - export namespace Data { - export type AsObject = { - status: number, - httpMethod: ListenResponse.EndpointResponse.Data.HttpMethod, - url: string, - eventId: string, - } - - export enum HttpMethod { - HTTP_METHOD_UNSPECIFIED = 0, - HTTP_METHOD_GET = 1, - HTTP_METHOD_POST = 2, - HTTP_METHOD_DELETE = 3, - } - - } - - - export enum ContentCase { - CONTENT_NOT_SET = 0, - DATA = 1, - ERROR = 2, - } - - } - - - export enum State { - STATE_UNSPECIFIED = 0, - STATE_LOADING = 1, - STATE_RECONNECTING = 2, - STATE_READY = 3, - STATE_DONE = 4, + export namespace Data { + export type AsObject = { + status: number, + httpMethod: ListenResponse.EndpointResponse.Data.HttpMethodMap[keyof ListenResponse.EndpointResponse.Data.HttpMethodMap], + url: string, + eventId: string, + } + + export interface HttpMethodMap { + HTTP_METHOD_UNSPECIFIED: 0; + HTTP_METHOD_GET: 1; + HTTP_METHOD_POST: 2; + HTTP_METHOD_DELETE: 3; + } + + export const HttpMethod: HttpMethodMap; } - export enum ContentCase { - CONTENT_NOT_SET = 0, - STATE = 1, - STRIPE_EVENT = 2, - ENDPOINT_RESPONSE = 3, + CONTENT_NOT_SET = 0, + DATA = 1, + ERROR = 2, } - + } + + export interface StateMap { + STATE_UNSPECIFIED: 0; + STATE_LOADING: 1; + STATE_RECONNECTING: 2; + STATE_READY: 3; + STATE_DONE: 4; + } + + export const State: StateMap; + + export enum ContentCase { + CONTENT_NOT_SET = 0, + STATE = 1, + STRIPE_EVENT = 2, + ENDPOINT_RESPONSE = 3, + } } + diff --git a/src/rpc/login_pb.d.ts b/src/rpc/login_pb.d.ts index cce37522..68ea087b 100644 --- a/src/rpc/login_pb.d.ts +++ b/src/rpc/login_pb.d.ts @@ -1,47 +1,45 @@ // package: rpc // file: login.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class LoginRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LoginRequest.AsObject; - static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LoginRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LoginRequest; - static deserializeBinaryFromReader(message: LoginRequest, reader: jspb.BinaryReader): LoginRequest; +export class LoginRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoginRequest.AsObject; + static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoginRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoginRequest; + static deserializeBinaryFromReader(message: LoginRequest, reader: jspb.BinaryReader): LoginRequest; } export namespace LoginRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class LoginResponse extends jspb.Message { - getUrl(): string; - setUrl(value: string): LoginResponse; - getPairingCode(): string; - setPairingCode(value: string): LoginResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LoginResponse.AsObject; - static toObject(includeInstance: boolean, msg: LoginResponse): LoginResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LoginResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LoginResponse; - static deserializeBinaryFromReader(message: LoginResponse, reader: jspb.BinaryReader): LoginResponse; +export class LoginResponse extends jspb.Message { + getUrl(): string; + setUrl(value: string): void; + + getPairingCode(): string; + setPairingCode(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoginResponse.AsObject; + static toObject(includeInstance: boolean, msg: LoginResponse): LoginResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoginResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoginResponse; + static deserializeBinaryFromReader(message: LoginResponse, reader: jspb.BinaryReader): LoginResponse; } export namespace LoginResponse { - export type AsObject = { - url: string, - pairingCode: string, - } + export type AsObject = { + url: string, + pairingCode: string, + } } + diff --git a/src/rpc/login_status_pb.d.ts b/src/rpc/login_status_pb.d.ts index 2a277420..44e57730 100644 --- a/src/rpc/login_status_pb.d.ts +++ b/src/rpc/login_status_pb.d.ts @@ -1,47 +1,45 @@ // package: rpc // file: login_status.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class LoginStatusRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LoginStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: LoginStatusRequest): LoginStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LoginStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LoginStatusRequest; - static deserializeBinaryFromReader(message: LoginStatusRequest, reader: jspb.BinaryReader): LoginStatusRequest; +export class LoginStatusRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoginStatusRequest.AsObject; + static toObject(includeInstance: boolean, msg: LoginStatusRequest): LoginStatusRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoginStatusRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoginStatusRequest; + static deserializeBinaryFromReader(message: LoginStatusRequest, reader: jspb.BinaryReader): LoginStatusRequest; } export namespace LoginStatusRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class LoginStatusResponse extends jspb.Message { - getAccountId(): string; - setAccountId(value: string): LoginStatusResponse; - getDisplayName(): string; - setDisplayName(value: string): LoginStatusResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LoginStatusResponse.AsObject; - static toObject(includeInstance: boolean, msg: LoginStatusResponse): LoginStatusResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LoginStatusResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LoginStatusResponse; - static deserializeBinaryFromReader(message: LoginStatusResponse, reader: jspb.BinaryReader): LoginStatusResponse; +export class LoginStatusResponse extends jspb.Message { + getAccountId(): string; + setAccountId(value: string): void; + + getDisplayName(): string; + setDisplayName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoginStatusResponse.AsObject; + static toObject(includeInstance: boolean, msg: LoginStatusResponse): LoginStatusResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoginStatusResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoginStatusResponse; + static deserializeBinaryFromReader(message: LoginStatusResponse, reader: jspb.BinaryReader): LoginStatusResponse; } export namespace LoginStatusResponse { - export type AsObject = { - accountId: string, - displayName: string, - } + export type AsObject = { + accountId: string, + displayName: string, + } } + diff --git a/src/rpc/logs_tail_pb.d.ts b/src/rpc/logs_tail_pb.d.ts index 5506e8ce..1c7e430c 100644 --- a/src/rpc/logs_tail_pb.d.ts +++ b/src/rpc/logs_tail_pb.d.ts @@ -1,225 +1,243 @@ // package: rpc // file: logs_tail.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class LogsTailRequest extends jspb.Message { - clearFilterAccountsList(): void; - getFilterAccountsList(): Array; - setFilterAccountsList(value: Array): LogsTailRequest; - addFilterAccounts(value: LogsTailRequest.Account, index?: number): LogsTailRequest.Account; - clearFilterHttpMethodsList(): void; - getFilterHttpMethodsList(): Array; - setFilterHttpMethodsList(value: Array): LogsTailRequest; - addFilterHttpMethods(value: LogsTailRequest.HttpMethod, index?: number): LogsTailRequest.HttpMethod; - clearFilterIpAddressesList(): void; - getFilterIpAddressesList(): Array; - setFilterIpAddressesList(value: Array): LogsTailRequest; - addFilterIpAddresses(value: string, index?: number): string; - clearFilterRequestPathsList(): void; - getFilterRequestPathsList(): Array; - setFilterRequestPathsList(value: Array): LogsTailRequest; - addFilterRequestPaths(value: string, index?: number): string; - clearFilterRequestStatusesList(): void; - getFilterRequestStatusesList(): Array; - setFilterRequestStatusesList(value: Array): LogsTailRequest; - addFilterRequestStatuses(value: LogsTailRequest.RequestStatus, index?: number): LogsTailRequest.RequestStatus; - clearFilterSourcesList(): void; - getFilterSourcesList(): Array; - setFilterSourcesList(value: Array): LogsTailRequest; - addFilterSources(value: LogsTailRequest.Source, index?: number): LogsTailRequest.Source; - clearFilterStatusCodesList(): void; - getFilterStatusCodesList(): Array; - setFilterStatusCodesList(value: Array): LogsTailRequest; - addFilterStatusCodes(value: string, index?: number): string; - clearFilterStatusCodeTypesList(): void; - getFilterStatusCodeTypesList(): Array; - setFilterStatusCodeTypesList(value: Array): LogsTailRequest; - addFilterStatusCodeTypes(value: LogsTailRequest.StatusCodeType, index?: number): LogsTailRequest.StatusCodeType; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LogsTailRequest.AsObject; - static toObject(includeInstance: boolean, msg: LogsTailRequest): LogsTailRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LogsTailRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LogsTailRequest; - static deserializeBinaryFromReader(message: LogsTailRequest, reader: jspb.BinaryReader): LogsTailRequest; +export class LogsTailRequest extends jspb.Message { + clearFilterAccountsList(): void; + getFilterAccountsList(): Array; + setFilterAccountsList(value: Array): void; + addFilterAccounts(value: LogsTailRequest.AccountMap[keyof LogsTailRequest.AccountMap], index?: number): LogsTailRequest.AccountMap[keyof LogsTailRequest.AccountMap]; + + clearFilterHttpMethodsList(): void; + getFilterHttpMethodsList(): Array; + setFilterHttpMethodsList(value: Array): void; + addFilterHttpMethods(value: LogsTailRequest.HttpMethodMap[keyof LogsTailRequest.HttpMethodMap], index?: number): LogsTailRequest.HttpMethodMap[keyof LogsTailRequest.HttpMethodMap]; + + clearFilterIpAddressesList(): void; + getFilterIpAddressesList(): Array; + setFilterIpAddressesList(value: Array): void; + addFilterIpAddresses(value: string, index?: number): string; + + clearFilterRequestPathsList(): void; + getFilterRequestPathsList(): Array; + setFilterRequestPathsList(value: Array): void; + addFilterRequestPaths(value: string, index?: number): string; + + clearFilterRequestStatusesList(): void; + getFilterRequestStatusesList(): Array; + setFilterRequestStatusesList(value: Array): void; + addFilterRequestStatuses(value: LogsTailRequest.RequestStatusMap[keyof LogsTailRequest.RequestStatusMap], index?: number): LogsTailRequest.RequestStatusMap[keyof LogsTailRequest.RequestStatusMap]; + + clearFilterSourcesList(): void; + getFilterSourcesList(): Array; + setFilterSourcesList(value: Array): void; + addFilterSources(value: LogsTailRequest.SourceMap[keyof LogsTailRequest.SourceMap], index?: number): LogsTailRequest.SourceMap[keyof LogsTailRequest.SourceMap]; + + clearFilterStatusCodesList(): void; + getFilterStatusCodesList(): Array; + setFilterStatusCodesList(value: Array): void; + addFilterStatusCodes(value: string, index?: number): string; + + clearFilterStatusCodeTypesList(): void; + getFilterStatusCodeTypesList(): Array; + setFilterStatusCodeTypesList(value: Array): void; + addFilterStatusCodeTypes(value: LogsTailRequest.StatusCodeTypeMap[keyof LogsTailRequest.StatusCodeTypeMap], index?: number): LogsTailRequest.StatusCodeTypeMap[keyof LogsTailRequest.StatusCodeTypeMap]; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LogsTailRequest.AsObject; + static toObject(includeInstance: boolean, msg: LogsTailRequest): LogsTailRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LogsTailRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LogsTailRequest; + static deserializeBinaryFromReader(message: LogsTailRequest, reader: jspb.BinaryReader): LogsTailRequest; } export namespace LogsTailRequest { - export type AsObject = { - filterAccountsList: Array, - filterHttpMethodsList: Array, - filterIpAddressesList: Array, - filterRequestPathsList: Array, - filterRequestStatusesList: Array, - filterSourcesList: Array, - filterStatusCodesList: Array, - filterStatusCodeTypesList: Array, - } - - export enum Account { - ACCOUNT_UNSPECIFIED = 0, - ACCOUNT_CONNECT_IN = 1, - ACCOUNT_CONNECT_OUT = 2, - ACCOUNT_SELF = 3, - } + export type AsObject = { + filterAccountsList: Array, + filterHttpMethodsList: Array, + filterIpAddressesList: Array, + filterRequestPathsList: Array, + filterRequestStatusesList: Array, + filterSourcesList: Array, + filterStatusCodesList: Array, + filterStatusCodeTypesList: Array, + } + + export interface AccountMap { + ACCOUNT_UNSPECIFIED: 0; + ACCOUNT_CONNECT_IN: 1; + ACCOUNT_CONNECT_OUT: 2; + ACCOUNT_SELF: 3; + } + + export const Account: AccountMap; + + export interface HttpMethodMap { + HTTP_METHOD_UNSPECIFIED: 0; + HTTP_METHOD_GET: 1; + HTTP_METHOD_POST: 2; + HTTP_METHOD_DELETE: 3; + } + + export const HttpMethod: HttpMethodMap; + + export interface RequestStatusMap { + REQUEST_STATUS_UNSPECIFIED: 0; + REQUEST_STATUS_SUCCEEDED: 1; + REQUEST_STATUS_FAILED: 2; + } + + export const RequestStatus: RequestStatusMap; + + export interface SourceMap { + SOURCE_UNSPECIFIED: 0; + SOURCE_API: 1; + SOURCE_DASHBOARD: 2; + } + + export const Source: SourceMap; + + export interface StatusCodeTypeMap { + STATUS_CODE_TYPE_UNSPECIFIED: 0; + STATUS_CODE_TYPE_2XX: 1; + STATUS_CODE_TYPE_4XX: 2; + STATUS_CODE_TYPE_5XX: 3; + } + + export const StatusCodeType: StatusCodeTypeMap; +} - export enum HttpMethod { - HTTP_METHOD_UNSPECIFIED = 0, - HTTP_METHOD_GET = 1, - HTTP_METHOD_POST = 2, - HTTP_METHOD_DELETE = 3, - } +export class LogsTailResponse extends jspb.Message { + hasState(): boolean; + clearState(): void; + getState(): LogsTailResponse.StateMap[keyof LogsTailResponse.StateMap]; + setState(value: LogsTailResponse.StateMap[keyof LogsTailResponse.StateMap]): void; + + hasLog(): boolean; + clearLog(): void; + getLog(): LogsTailResponse.Log | undefined; + setLog(value?: LogsTailResponse.Log): void; + + getContentCase(): LogsTailResponse.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LogsTailResponse.AsObject; + static toObject(includeInstance: boolean, msg: LogsTailResponse): LogsTailResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LogsTailResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LogsTailResponse; + static deserializeBinaryFromReader(message: LogsTailResponse, reader: jspb.BinaryReader): LogsTailResponse; +} - export enum RequestStatus { - REQUEST_STATUS_UNSPECIFIED = 0, - REQUEST_STATUS_SUCCEEDED = 1, - REQUEST_STATUS_FAILED = 2, - } +export namespace LogsTailResponse { + export type AsObject = { + state: LogsTailResponse.StateMap[keyof LogsTailResponse.StateMap], + log?: LogsTailResponse.Log.AsObject, + } - export enum Source { - SOURCE_UNSPECIFIED = 0, - SOURCE_API = 1, - SOURCE_DASHBOARD = 2, - } + export class Log extends jspb.Message { + getLivemode(): boolean; + setLivemode(value: boolean): void; - export enum StatusCodeType { - STATUS_CODE_TYPE_UNSPECIFIED = 0, - STATUS_CODE_TYPE_2XX = 1, - STATUS_CODE_TYPE_4XX = 2, - STATUS_CODE_TYPE_5XX = 3, - } + getMethod(): string; + setMethod(value: string): void; -} + getUrl(): string; + setUrl(value: string): void; -export class LogsTailResponse extends jspb.Message { + getStatus(): number; + setStatus(value: number): void; - hasState(): boolean; - clearState(): void; - getState(): LogsTailResponse.State; - setState(value: LogsTailResponse.State): LogsTailResponse; + getRequestId(): string; + setRequestId(value: string): void; - hasLog(): boolean; - clearLog(): void; - getLog(): LogsTailResponse.Log | undefined; - setLog(value?: LogsTailResponse.Log): LogsTailResponse; + getCreatedAt(): number; + setCreatedAt(value: number): void; - getContentCase(): LogsTailResponse.ContentCase; + hasError(): boolean; + clearError(): void; + getError(): LogsTailResponse.Log.Error | undefined; + setError(value?: LogsTailResponse.Log.Error): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LogsTailResponse.AsObject; - static toObject(includeInstance: boolean, msg: LogsTailResponse): LogsTailResponse.AsObject; + toObject(includeInstance?: boolean): Log.AsObject; + static toObject(includeInstance: boolean, msg: Log): Log.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LogsTailResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LogsTailResponse; - static deserializeBinaryFromReader(message: LogsTailResponse, reader: jspb.BinaryReader): LogsTailResponse; -} + static serializeBinaryToWriter(message: Log, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Log; + static deserializeBinaryFromReader(message: Log, reader: jspb.BinaryReader): Log; + } -export namespace LogsTailResponse { + export namespace Log { export type AsObject = { - state: LogsTailResponse.State, - log?: LogsTailResponse.Log.AsObject, + livemode: boolean, + method: string, + url: string, + status: number, + requestId: string, + createdAt: number, + error?: LogsTailResponse.Log.Error.AsObject, } + export class Error extends jspb.Message { + getType(): string; + setType(value: string): void; - export class Log extends jspb.Message { - getLivemode(): boolean; - setLivemode(value: boolean): Log; - getMethod(): string; - setMethod(value: string): Log; - getUrl(): string; - setUrl(value: string): Log; - getStatus(): number; - setStatus(value: number): Log; - getRequestId(): string; - setRequestId(value: string): Log; - getCreatedAt(): number; - setCreatedAt(value: number): Log; - - hasError(): boolean; - clearError(): void; - getError(): LogsTailResponse.Log.Error | undefined; - setError(value?: LogsTailResponse.Log.Error): Log; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Log.AsObject; - static toObject(includeInstance: boolean, msg: Log): Log.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Log, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Log; - static deserializeBinaryFromReader(message: Log, reader: jspb.BinaryReader): Log; - } - - export namespace Log { - export type AsObject = { - livemode: boolean, - method: string, - url: string, - status: number, - requestId: string, - createdAt: number, - error?: LogsTailResponse.Log.Error.AsObject, - } - - - export class Error extends jspb.Message { - getType(): string; - setType(value: string): Error; - getCharge(): string; - setCharge(value: string): Error; - getCode(): string; - setCode(value: string): Error; - getDeclineCode(): string; - setDeclineCode(value: string): Error; - getMessage(): string; - setMessage(value: string): Error; - getParam(): string; - setParam(value: string): Error; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Error.AsObject; - static toObject(includeInstance: boolean, msg: Error): Error.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Error, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Error; - static deserializeBinaryFromReader(message: Error, reader: jspb.BinaryReader): Error; - } - - export namespace Error { - export type AsObject = { - type: string, - charge: string, - code: string, - declineCode: string, - message: string, - param: string, - } - } + getCharge(): string; + setCharge(value: string): void; - } + getCode(): string; + setCode(value: string): void; + getDeclineCode(): string; + setDeclineCode(value: string): void; - export enum State { - STATE_UNSPECIFIED = 0, - STATE_LOADING = 1, - STATE_RECONNECTING = 2, - STATE_READY = 3, - STATE_DONE = 4, - } + getMessage(): string; + setMessage(value: string): void; + getParam(): string; + setParam(value: string): void; - export enum ContentCase { - CONTENT_NOT_SET = 0, - STATE = 1, - LOG = 2, + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Error.AsObject; + static toObject(includeInstance: boolean, msg: Error): Error.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Error, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Error; + static deserializeBinaryFromReader(message: Error, reader: jspb.BinaryReader): Error; } + export namespace Error { + export type AsObject = { + type: string, + charge: string, + code: string, + declineCode: string, + message: string, + param: string, + } + } + } + + export interface StateMap { + STATE_UNSPECIFIED: 0; + STATE_LOADING: 1; + STATE_RECONNECTING: 2; + STATE_READY: 3; + STATE_DONE: 4; + } + + export const State: StateMap; + + export enum ContentCase { + CONTENT_NOT_SET = 0, + STATE = 1, + LOG = 2, + } } + diff --git a/src/rpc/sample_configs_pb.d.ts b/src/rpc/sample_configs_pb.d.ts index f65db914..dc3537b9 100644 --- a/src/rpc/sample_configs_pb.d.ts +++ b/src/rpc/sample_configs_pb.d.ts @@ -1,81 +1,79 @@ // package: rpc // file: sample_configs.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class SampleConfigsRequest extends jspb.Message { - getSampleName(): string; - setSampleName(value: string): SampleConfigsRequest; +export class SampleConfigsRequest extends jspb.Message { + getSampleName(): string; + setSampleName(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SampleConfigsRequest.AsObject; - static toObject(includeInstance: boolean, msg: SampleConfigsRequest): SampleConfigsRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SampleConfigsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SampleConfigsRequest; - static deserializeBinaryFromReader(message: SampleConfigsRequest, reader: jspb.BinaryReader): SampleConfigsRequest; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SampleConfigsRequest.AsObject; + static toObject(includeInstance: boolean, msg: SampleConfigsRequest): SampleConfigsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SampleConfigsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SampleConfigsRequest; + static deserializeBinaryFromReader(message: SampleConfigsRequest, reader: jspb.BinaryReader): SampleConfigsRequest; } export namespace SampleConfigsRequest { - export type AsObject = { - sampleName: string, - } + export type AsObject = { + sampleName: string, + } } -export class SampleConfigsResponse extends jspb.Message { - clearIntegrationsList(): void; - getIntegrationsList(): Array; - setIntegrationsList(value: Array): SampleConfigsResponse; - addIntegrations(value?: SampleConfigsResponse.Integration, index?: number): SampleConfigsResponse.Integration; +export class SampleConfigsResponse extends jspb.Message { + clearIntegrationsList(): void; + getIntegrationsList(): Array; + setIntegrationsList(value: Array): void; + addIntegrations(value?: SampleConfigsResponse.Integration, index?: number): SampleConfigsResponse.Integration; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SampleConfigsResponse.AsObject; - static toObject(includeInstance: boolean, msg: SampleConfigsResponse): SampleConfigsResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SampleConfigsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SampleConfigsResponse; - static deserializeBinaryFromReader(message: SampleConfigsResponse, reader: jspb.BinaryReader): SampleConfigsResponse; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SampleConfigsResponse.AsObject; + static toObject(includeInstance: boolean, msg: SampleConfigsResponse): SampleConfigsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SampleConfigsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SampleConfigsResponse; + static deserializeBinaryFromReader(message: SampleConfigsResponse, reader: jspb.BinaryReader): SampleConfigsResponse; } export namespace SampleConfigsResponse { - export type AsObject = { - integrationsList: Array, - } + export type AsObject = { + integrationsList: Array, + } + export class Integration extends jspb.Message { + getIntegrationName(): string; + setIntegrationName(value: string): void; - export class Integration extends jspb.Message { - getIntegrationName(): string; - setIntegrationName(value: string): Integration; - clearClientsList(): void; - getClientsList(): Array; - setClientsList(value: Array): Integration; - addClients(value: string, index?: number): string; - clearServersList(): void; - getServersList(): Array; - setServersList(value: Array): Integration; - addServers(value: string, index?: number): string; + clearClientsList(): void; + getClientsList(): Array; + setClientsList(value: Array): void; + addClients(value: string, index?: number): string; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Integration.AsObject; - static toObject(includeInstance: boolean, msg: Integration): Integration.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Integration, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Integration; - static deserializeBinaryFromReader(message: Integration, reader: jspb.BinaryReader): Integration; - } + clearServersList(): void; + getServersList(): Array; + setServersList(value: Array): void; + addServers(value: string, index?: number): string; - export namespace Integration { - export type AsObject = { - integrationName: string, - clientsList: Array, - serversList: Array, - } - } + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Integration.AsObject; + static toObject(includeInstance: boolean, msg: Integration): Integration.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Integration, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Integration; + static deserializeBinaryFromReader(message: Integration, reader: jspb.BinaryReader): Integration; + } + export namespace Integration { + export type AsObject = { + integrationName: string, + clientsList: Array, + serversList: Array, + } + } } + diff --git a/src/rpc/sample_create_pb.d.ts b/src/rpc/sample_create_pb.d.ts index 1ad3bcf2..a729cee7 100644 --- a/src/rpc/sample_create_pb.d.ts +++ b/src/rpc/sample_create_pb.d.ts @@ -1,65 +1,69 @@ // package: rpc // file: sample_create.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class SampleCreateRequest extends jspb.Message { - getSampleName(): string; - setSampleName(value: string): SampleCreateRequest; - getIntegrationName(): string; - setIntegrationName(value: string): SampleCreateRequest; - getClient(): string; - setClient(value: string): SampleCreateRequest; - getServer(): string; - setServer(value: string): SampleCreateRequest; - getPath(): string; - setPath(value: string): SampleCreateRequest; - getForceRefresh(): boolean; - setForceRefresh(value: boolean): SampleCreateRequest; +export class SampleCreateRequest extends jspb.Message { + getSampleName(): string; + setSampleName(value: string): void; + + getIntegrationName(): string; + setIntegrationName(value: string): void; + + getClient(): string; + setClient(value: string): void; + + getServer(): string; + setServer(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SampleCreateRequest.AsObject; - static toObject(includeInstance: boolean, msg: SampleCreateRequest): SampleCreateRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SampleCreateRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SampleCreateRequest; - static deserializeBinaryFromReader(message: SampleCreateRequest, reader: jspb.BinaryReader): SampleCreateRequest; + getPath(): string; + setPath(value: string): void; + + getForceRefresh(): boolean; + setForceRefresh(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SampleCreateRequest.AsObject; + static toObject(includeInstance: boolean, msg: SampleCreateRequest): SampleCreateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SampleCreateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SampleCreateRequest; + static deserializeBinaryFromReader(message: SampleCreateRequest, reader: jspb.BinaryReader): SampleCreateRequest; } export namespace SampleCreateRequest { - export type AsObject = { - sampleName: string, - integrationName: string, - client: string, - server: string, - path: string, - forceRefresh: boolean, - } + export type AsObject = { + sampleName: string, + integrationName: string, + client: string, + server: string, + path: string, + forceRefresh: boolean, + } } -export class SampleCreateResponse extends jspb.Message { - getPostInstall(): string; - setPostInstall(value: string): SampleCreateResponse; - getPath(): string; - setPath(value: string): SampleCreateResponse; +export class SampleCreateResponse extends jspb.Message { + getPostInstall(): string; + setPostInstall(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SampleCreateResponse.AsObject; - static toObject(includeInstance: boolean, msg: SampleCreateResponse): SampleCreateResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SampleCreateResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SampleCreateResponse; - static deserializeBinaryFromReader(message: SampleCreateResponse, reader: jspb.BinaryReader): SampleCreateResponse; + getPath(): string; + setPath(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SampleCreateResponse.AsObject; + static toObject(includeInstance: boolean, msg: SampleCreateResponse): SampleCreateResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SampleCreateResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SampleCreateResponse; + static deserializeBinaryFromReader(message: SampleCreateResponse, reader: jspb.BinaryReader): SampleCreateResponse; } export namespace SampleCreateResponse { - export type AsObject = { - postInstall: string, - path: string, - } + export type AsObject = { + postInstall: string, + path: string, + } } + diff --git a/src/rpc/samples_list_pb.d.ts b/src/rpc/samples_list_pb.d.ts index de8c50c7..a2224d5a 100644 --- a/src/rpc/samples_list_pb.d.ts +++ b/src/rpc/samples_list_pb.d.ts @@ -1,74 +1,71 @@ // package: rpc // file: samples_list.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class SamplesListRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SamplesListRequest.AsObject; - static toObject(includeInstance: boolean, msg: SamplesListRequest): SamplesListRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SamplesListRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SamplesListRequest; - static deserializeBinaryFromReader(message: SamplesListRequest, reader: jspb.BinaryReader): SamplesListRequest; +export class SamplesListRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SamplesListRequest.AsObject; + static toObject(includeInstance: boolean, msg: SamplesListRequest): SamplesListRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SamplesListRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SamplesListRequest; + static deserializeBinaryFromReader(message: SamplesListRequest, reader: jspb.BinaryReader): SamplesListRequest; } export namespace SamplesListRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class SamplesListResponse extends jspb.Message { - clearSamplesList(): void; - getSamplesList(): Array; - setSamplesList(value: Array): SamplesListResponse; - addSamples(value?: SamplesListResponse.SampleData, index?: number): SamplesListResponse.SampleData; +export class SamplesListResponse extends jspb.Message { + clearSamplesList(): void; + getSamplesList(): Array; + setSamplesList(value: Array): void; + addSamples(value?: SamplesListResponse.SampleData, index?: number): SamplesListResponse.SampleData; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SamplesListResponse.AsObject; - static toObject(includeInstance: boolean, msg: SamplesListResponse): SamplesListResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SamplesListResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SamplesListResponse; - static deserializeBinaryFromReader(message: SamplesListResponse, reader: jspb.BinaryReader): SamplesListResponse; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SamplesListResponse.AsObject; + static toObject(includeInstance: boolean, msg: SamplesListResponse): SamplesListResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SamplesListResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SamplesListResponse; + static deserializeBinaryFromReader(message: SamplesListResponse, reader: jspb.BinaryReader): SamplesListResponse; } export namespace SamplesListResponse { - export type AsObject = { - samplesList: Array, - } + export type AsObject = { + samplesList: Array, + } + export class SampleData extends jspb.Message { + getName(): string; + setName(value: string): void; - export class SampleData extends jspb.Message { - getName(): string; - setName(value: string): SampleData; - getUrl(): string; - setUrl(value: string): SampleData; - getDescription(): string; - setDescription(value: string): SampleData; + getUrl(): string; + setUrl(value: string): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SampleData.AsObject; - static toObject(includeInstance: boolean, msg: SampleData): SampleData.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SampleData, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SampleData; - static deserializeBinaryFromReader(message: SampleData, reader: jspb.BinaryReader): SampleData; - } + getDescription(): string; + setDescription(value: string): void; - export namespace SampleData { - export type AsObject = { - name: string, - url: string, - description: string, - } - } + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SampleData.AsObject; + static toObject(includeInstance: boolean, msg: SampleData): SampleData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SampleData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SampleData; + static deserializeBinaryFromReader(message: SampleData, reader: jspb.BinaryReader): SampleData; + } + export namespace SampleData { + export type AsObject = { + name: string, + url: string, + description: string, + } + } } + diff --git a/src/rpc/trigger_pb.d.ts b/src/rpc/trigger_pb.d.ts index bc85d621..376aa550 100644 --- a/src/rpc/trigger_pb.d.ts +++ b/src/rpc/trigger_pb.d.ts @@ -1,75 +1,79 @@ // package: rpc // file: trigger.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class TriggerRequest extends jspb.Message { - getEvent(): string; - setEvent(value: string): TriggerRequest; - getStripeAccount(): string; - setStripeAccount(value: string): TriggerRequest; - clearSkipList(): void; - getSkipList(): Array; - setSkipList(value: Array): TriggerRequest; - addSkip(value: string, index?: number): string; - clearOverrideList(): void; - getOverrideList(): Array; - setOverrideList(value: Array): TriggerRequest; - addOverride(value: string, index?: number): string; - clearAddList(): void; - getAddList(): Array; - setAddList(value: Array): TriggerRequest; - addAdd(value: string, index?: number): string; - clearRemoveList(): void; - getRemoveList(): Array; - setRemoveList(value: Array): TriggerRequest; - addRemove(value: string, index?: number): string; - getRaw(): string; - setRaw(value: string): TriggerRequest; +export class TriggerRequest extends jspb.Message { + getEvent(): string; + setEvent(value: string): void; + + getStripeAccount(): string; + setStripeAccount(value: string): void; + + clearSkipList(): void; + getSkipList(): Array; + setSkipList(value: Array): void; + addSkip(value: string, index?: number): string; + + clearOverrideList(): void; + getOverrideList(): Array; + setOverrideList(value: Array): void; + addOverride(value: string, index?: number): string; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggerRequest.AsObject; - static toObject(includeInstance: boolean, msg: TriggerRequest): TriggerRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggerRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggerRequest; - static deserializeBinaryFromReader(message: TriggerRequest, reader: jspb.BinaryReader): TriggerRequest; + clearAddList(): void; + getAddList(): Array; + setAddList(value: Array): void; + addAdd(value: string, index?: number): string; + + clearRemoveList(): void; + getRemoveList(): Array; + setRemoveList(value: Array): void; + addRemove(value: string, index?: number): string; + + getRaw(): string; + setRaw(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TriggerRequest.AsObject; + static toObject(includeInstance: boolean, msg: TriggerRequest): TriggerRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TriggerRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TriggerRequest; + static deserializeBinaryFromReader(message: TriggerRequest, reader: jspb.BinaryReader): TriggerRequest; } export namespace TriggerRequest { - export type AsObject = { - event: string, - stripeAccount: string, - skipList: Array, - overrideList: Array, - addList: Array, - removeList: Array, - raw: string, - } + export type AsObject = { + event: string, + stripeAccount: string, + skipList: Array, + overrideList: Array, + addList: Array, + removeList: Array, + raw: string, + } } -export class TriggerResponse extends jspb.Message { - clearRequestsList(): void; - getRequestsList(): Array; - setRequestsList(value: Array): TriggerResponse; - addRequests(value: string, index?: number): string; +export class TriggerResponse extends jspb.Message { + clearRequestsList(): void; + getRequestsList(): Array; + setRequestsList(value: Array): void; + addRequests(value: string, index?: number): string; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggerResponse.AsObject; - static toObject(includeInstance: boolean, msg: TriggerResponse): TriggerResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggerResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggerResponse; - static deserializeBinaryFromReader(message: TriggerResponse, reader: jspb.BinaryReader): TriggerResponse; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TriggerResponse.AsObject; + static toObject(includeInstance: boolean, msg: TriggerResponse): TriggerResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TriggerResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TriggerResponse; + static deserializeBinaryFromReader(message: TriggerResponse, reader: jspb.BinaryReader): TriggerResponse; } export namespace TriggerResponse { - export type AsObject = { - requestsList: Array, - } + export type AsObject = { + requestsList: Array, + } } + diff --git a/src/rpc/triggers_list_pb.d.ts b/src/rpc/triggers_list_pb.d.ts index b8df4209..d743fec5 100644 --- a/src/rpc/triggers_list_pb.d.ts +++ b/src/rpc/triggers_list_pb.d.ts @@ -1,46 +1,43 @@ // package: rpc // file: triggers_list.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class TriggersListRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggersListRequest.AsObject; - static toObject(includeInstance: boolean, msg: TriggersListRequest): TriggersListRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggersListRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggersListRequest; - static deserializeBinaryFromReader(message: TriggersListRequest, reader: jspb.BinaryReader): TriggersListRequest; +export class TriggersListRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TriggersListRequest.AsObject; + static toObject(includeInstance: boolean, msg: TriggersListRequest): TriggersListRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TriggersListRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TriggersListRequest; + static deserializeBinaryFromReader(message: TriggersListRequest, reader: jspb.BinaryReader): TriggersListRequest; } export namespace TriggersListRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class TriggersListResponse extends jspb.Message { - clearEventsList(): void; - getEventsList(): Array; - setEventsList(value: Array): TriggersListResponse; - addEvents(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggersListResponse.AsObject; - static toObject(includeInstance: boolean, msg: TriggersListResponse): TriggersListResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggersListResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggersListResponse; - static deserializeBinaryFromReader(message: TriggersListResponse, reader: jspb.BinaryReader): TriggersListResponse; +export class TriggersListResponse extends jspb.Message { + clearEventsList(): void; + getEventsList(): Array; + setEventsList(value: Array): void; + addEvents(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TriggersListResponse.AsObject; + static toObject(includeInstance: boolean, msg: TriggersListResponse): TriggersListResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TriggersListResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TriggersListResponse; + static deserializeBinaryFromReader(message: TriggersListResponse, reader: jspb.BinaryReader): TriggersListResponse; } export namespace TriggersListResponse { - export type AsObject = { - eventsList: Array, - } + export type AsObject = { + eventsList: Array, + } } + diff --git a/src/rpc/version_pb.d.ts b/src/rpc/version_pb.d.ts index 132aa4a0..ef95fc10 100644 --- a/src/rpc/version_pb.d.ts +++ b/src/rpc/version_pb.d.ts @@ -1,44 +1,41 @@ // package: rpc // file: version.proto -/* tslint:disable */ -/* eslint-disable */ - import * as jspb from "google-protobuf"; -export class VersionRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): VersionRequest.AsObject; - static toObject(includeInstance: boolean, msg: VersionRequest): VersionRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: VersionRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): VersionRequest; - static deserializeBinaryFromReader(message: VersionRequest, reader: jspb.BinaryReader): VersionRequest; +export class VersionRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): VersionRequest.AsObject; + static toObject(includeInstance: boolean, msg: VersionRequest): VersionRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: VersionRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): VersionRequest; + static deserializeBinaryFromReader(message: VersionRequest, reader: jspb.BinaryReader): VersionRequest; } export namespace VersionRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class VersionResponse extends jspb.Message { - getVersion(): string; - setVersion(value: string): VersionResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): VersionResponse.AsObject; - static toObject(includeInstance: boolean, msg: VersionResponse): VersionResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: VersionResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): VersionResponse; - static deserializeBinaryFromReader(message: VersionResponse, reader: jspb.BinaryReader): VersionResponse; +export class VersionResponse extends jspb.Message { + getVersion(): string; + setVersion(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): VersionResponse.AsObject; + static toObject(includeInstance: boolean, msg: VersionResponse): VersionResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: VersionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): VersionResponse; + static deserializeBinaryFromReader(message: VersionResponse, reader: jspb.BinaryReader): VersionResponse; } export namespace VersionResponse { - export type AsObject = { - version: string, - } + export type AsObject = { + version: string, + } } + diff --git a/src/rpc/webhook_endpoints_list_grpc_pb.d.ts b/src/rpc/webhook_endpoints_list_grpc_pb.d.ts new file mode 100644 index 00000000..51b4d695 --- /dev/null +++ b/src/rpc/webhook_endpoints_list_grpc_pb.d.ts @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO diff --git a/src/rpc/webhook_endpoints_list_grpc_pb.js b/src/rpc/webhook_endpoints_list_grpc_pb.js new file mode 100644 index 00000000..97b3a246 --- /dev/null +++ b/src/rpc/webhook_endpoints_list_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/src/rpc/webhook_endpoints_list_pb.d.ts b/src/rpc/webhook_endpoints_list_pb.d.ts new file mode 100644 index 00000000..798edd4a --- /dev/null +++ b/src/rpc/webhook_endpoints_list_pb.d.ts @@ -0,0 +1,77 @@ +// package: rpc +// file: webhook_endpoints_list.proto + +import * as jspb from "google-protobuf"; + +export class WebhookEndpointsListRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebhookEndpointsListRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebhookEndpointsListRequest): WebhookEndpointsListRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebhookEndpointsListRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebhookEndpointsListRequest; + static deserializeBinaryFromReader(message: WebhookEndpointsListRequest, reader: jspb.BinaryReader): WebhookEndpointsListRequest; +} + +export namespace WebhookEndpointsListRequest { + export type AsObject = { + } +} + +export class WebhookEndpointsListResponse extends jspb.Message { + clearEndpointsList(): void; + getEndpointsList(): Array; + setEndpointsList(value: Array): void; + addEndpoints(value?: WebhookEndpointsListResponse.WebhookEndpointData, index?: number): WebhookEndpointsListResponse.WebhookEndpointData; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebhookEndpointsListResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebhookEndpointsListResponse): WebhookEndpointsListResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebhookEndpointsListResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebhookEndpointsListResponse; + static deserializeBinaryFromReader(message: WebhookEndpointsListResponse, reader: jspb.BinaryReader): WebhookEndpointsListResponse; +} + +export namespace WebhookEndpointsListResponse { + export type AsObject = { + endpointsList: Array, + } + + export class WebhookEndpointData extends jspb.Message { + getApplication(): string; + setApplication(value: string): void; + + clearEnabledeventsList(): void; + getEnabledeventsList(): Array; + setEnabledeventsList(value: Array): void; + addEnabledevents(value: string, index?: number): string; + + getUrl(): string; + setUrl(value: string): void; + + getStatus(): string; + setStatus(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebhookEndpointData.AsObject; + static toObject(includeInstance: boolean, msg: WebhookEndpointData): WebhookEndpointData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebhookEndpointData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebhookEndpointData; + static deserializeBinaryFromReader(message: WebhookEndpointData, reader: jspb.BinaryReader): WebhookEndpointData; + } + + export namespace WebhookEndpointData { + export type AsObject = { + application: string, + enabledeventsList: Array, + url: string, + status: string, + } + } +} + diff --git a/src/rpc/webhook_endpoints_list_pb.js b/src/rpc/webhook_endpoints_list_pb.js new file mode 100644 index 00000000..dc1e8428 --- /dev/null +++ b/src/rpc/webhook_endpoints_list_pb.js @@ -0,0 +1,591 @@ +// source: webhook_endpoints_list.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.rpc.WebhookEndpointsListRequest', null, global); +goog.exportSymbol('proto.rpc.WebhookEndpointsListResponse', null, global); +goog.exportSymbol('proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.rpc.WebhookEndpointsListRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.rpc.WebhookEndpointsListRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.rpc.WebhookEndpointsListRequest.displayName = 'proto.rpc.WebhookEndpointsListRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.rpc.WebhookEndpointsListResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.rpc.WebhookEndpointsListResponse.repeatedFields_, null); +}; +goog.inherits(proto.rpc.WebhookEndpointsListResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.rpc.WebhookEndpointsListResponse.displayName = 'proto.rpc.WebhookEndpointsListResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.repeatedFields_, null); +}; +goog.inherits(proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.displayName = 'proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.rpc.WebhookEndpointsListRequest.prototype.toObject = function(opt_includeInstance) { + return proto.rpc.WebhookEndpointsListRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.rpc.WebhookEndpointsListRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.rpc.WebhookEndpointsListRequest} + */ +proto.rpc.WebhookEndpointsListRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.rpc.WebhookEndpointsListRequest; + return proto.rpc.WebhookEndpointsListRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.rpc.WebhookEndpointsListRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.rpc.WebhookEndpointsListRequest} + */ +proto.rpc.WebhookEndpointsListRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.rpc.WebhookEndpointsListRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.rpc.WebhookEndpointsListRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.rpc.WebhookEndpointsListRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.rpc.WebhookEndpointsListResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.rpc.WebhookEndpointsListResponse.prototype.toObject = function(opt_includeInstance) { + return proto.rpc.WebhookEndpointsListResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.rpc.WebhookEndpointsListResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListResponse.toObject = function(includeInstance, msg) { + var f, obj = { + endpointsList: jspb.Message.toObjectList(msg.getEndpointsList(), + proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.rpc.WebhookEndpointsListResponse} + */ +proto.rpc.WebhookEndpointsListResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.rpc.WebhookEndpointsListResponse; + return proto.rpc.WebhookEndpointsListResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.rpc.WebhookEndpointsListResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.rpc.WebhookEndpointsListResponse} + */ +proto.rpc.WebhookEndpointsListResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData; + reader.readMessage(value,proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.deserializeBinaryFromReader); + msg.addEndpoints(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.rpc.WebhookEndpointsListResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.rpc.WebhookEndpointsListResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.rpc.WebhookEndpointsListResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEndpointsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.toObject = function(opt_includeInstance) { + return proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.toObject = function(includeInstance, msg) { + var f, obj = { + application: jspb.Message.getFieldWithDefault(msg, 1, ""), + enabledeventsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + url: jspb.Message.getFieldWithDefault(msg, 3, ""), + status: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData; + return proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setApplication(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addEnabledevents(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getApplication(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getEnabledeventsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getStatus(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string application = 1; + * @return {string} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.getApplication = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.setApplication = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string enabledEvents = 2; + * @return {!Array} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.getEnabledeventsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.setEnabledeventsList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.addEnabledevents = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.clearEnabledeventsList = function() { + return this.setEnabledeventsList([]); +}; + + +/** + * optional string url = 3; + * @return {string} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string status = 4; + * @return {string} + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.getStatus = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} returns this + */ +proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData.prototype.setStatus = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated WebhookEndpointData endpoints = 1; + * @return {!Array} + */ +proto.rpc.WebhookEndpointsListResponse.prototype.getEndpointsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.rpc.WebhookEndpointsListResponse} returns this +*/ +proto.rpc.WebhookEndpointsListResponse.prototype.setEndpointsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData=} opt_value + * @param {number=} opt_index + * @return {!proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData} + */ +proto.rpc.WebhookEndpointsListResponse.prototype.addEndpoints = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.rpc.WebhookEndpointsListResponse.WebhookEndpointData, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.rpc.WebhookEndpointsListResponse} returns this + */ +proto.rpc.WebhookEndpointsListResponse.prototype.clearEndpointsList = function() { + return this.setEndpointsList([]); +}; + + +goog.object.extend(exports, proto.rpc); diff --git a/src/stripeWebhooksView.ts b/src/stripeWebhooksView.ts new file mode 100644 index 00000000..44f89981 --- /dev/null +++ b/src/stripeWebhooksView.ts @@ -0,0 +1,86 @@ +import * as vscode from 'vscode'; +import {StripeDaemon} from './daemon/stripeDaemon'; +import {StripeTreeItem} from './stripeTreeItem'; +import {StripeTreeViewDataProvider} from './stripeTreeViewDataProvider'; +// import {ThemeIcon} from 'vscode'; +import {WebhookEndpointsListRequest} from './rpc/webhook_endpoints_list_pb'; + +export class StripeWebhooksViewProvider extends StripeTreeViewDataProvider { + private stripeDaemon: StripeDaemon; + private endpointItems: StripeTreeItem[]; + + constructor(stripeDaemon: StripeDaemon) { + super(); + this.stripeDaemon = stripeDaemon; + this.endpointItems = []; + } + + buildTree(): Promise { + const items = []; + + // DX-7014 + // const createEndpoint = new StripeTreeItem('Create a new webhook endpoint', { + // commandString: 'createWebhookEndpoint', + // iconPath: new ThemeIcon('add'), + // tooltip: 'Create a new webhook endpoint', + // contextValue: 'createWebhookEndpoint', + // }); + // items.push(createEndpoint); + + if (this.endpointItems.length > 0) { + const endpointsRootItem = new StripeTreeItem('All webhook endpoints'); + endpointsRootItem.children = this.endpointItems; + endpointsRootItem.expand(); + endpointsRootItem.makeCollapsible(); + items.push(endpointsRootItem); + } + + return Promise.resolve(items); + } + + async refreshEndpoints() { + const daemonClient = await this.stripeDaemon.setupClient(); + daemonClient.webhookEndpointsList(new WebhookEndpointsListRequest(), (error, response) => { + if (error) { + if (error.code === 12) { + // https://grpc.github.io/grpc/core/md_doc_statuscodes.html + // 12: UNIMPLEMENTED + vscode.window.showErrorMessage( + 'Please upgrade your Stripe CLI to the latest version to use this feature.', + ); + } else { + vscode.window.showErrorMessage(`Failed to get all webhookendpoints. ${error.details}`); + } + } else if (response) { + const endpoints = response.getEndpointsList(); + if (endpoints.length > 0) { + const endpointItems = endpoints.map((e) => { + const enabledEventsRootItem = new StripeTreeItem('Enabled events'); + const enabledEvents = e.getEnabledeventsList(); + enabledEventsRootItem.children = enabledEvents.map( + (event) => new StripeTreeItem(event), + ); + enabledEventsRootItem.expand(); + enabledEventsRootItem.makeCollapsible(); + + const endpointItem = new StripeTreeItem(e.getUrl()); + endpointItem.children = [ + new StripeTreeItem(`Status: ${e.getStatus()}`), + enabledEventsRootItem, + ]; + endpointItem.expand(); + endpointItem.makeCollapsible(); + + return endpointItem; + }); + this.endpointItems = endpointItems; + this.refresh(); + } + } + }); + } + + getEndpoints() { + return this.endpointItems; + } +} diff --git a/test/suite/commands.test.ts b/test/suite/commands.test.ts index 87318e52..c752b321 100644 --- a/test/suite/commands.test.ts +++ b/test/suite/commands.test.ts @@ -425,8 +425,8 @@ suite('commands', function () { test('surfaces error from server', async () => { const windowSpy = sandbox.spy(vscode.window, 'showErrorMessage'); - const erroMessage = 'Something went wrong'; - const error = {details: erroMessage}; + const errorMessage = 'Something went wrong'; + const error = {details: errorMessage}; sandbox .stub(daemonClient, 'eventsResend') @@ -445,7 +445,7 @@ suite('commands', function () { const commands = new Commands(telemetry, terminal, extensionContext); await commands.resendEvent(treeItem, stripeDaemon, stripeOutputChannel); - assert.deepStrictEqual(windowSpy.args[0], [`Failed to resend event: 1234. ${erroMessage}`]); + assert.deepStrictEqual(windowSpy.args[0], [`Failed to resend event: 1234. ${errorMessage}`]); }); }); diff --git a/test/suite/stripeWebhooksView.test.ts b/test/suite/stripeWebhooksView.test.ts new file mode 100644 index 00000000..52008b26 --- /dev/null +++ b/test/suite/stripeWebhooksView.test.ts @@ -0,0 +1,96 @@ +import * as assert from 'assert'; +import * as grpc from '@grpc/grpc-js'; +import * as sinon from 'sinon'; +import * as vscode from 'vscode'; +import { + WebhookEndpointsListRequest, + WebhookEndpointsListResponse, +} from '../../src/rpc/webhook_endpoints_list_pb'; +import {StripeCLIClient} from '../../src/rpc/commands_grpc_pb'; +import {StripeDaemon} from '../../src/daemon/stripeDaemon'; +import {StripeWebhooksViewProvider} from '../../src/stripeWebhooksView'; + +suite('stripeWebhooksView', () => { + let sandbox: sinon.SinonSandbox; + + const stripeDaemon = >{ + setupClient: () => {}, + restartDaemon: () => {}, + }; + + const daemonClient = >{ + webhookEndpointsList: ( + req: WebhookEndpointsListRequest, + callback: (error: grpc.ServiceError | null, res: WebhookEndpointsListResponse) => void, + ) => { + callback(null, new WebhookEndpointsListResponse()); + }, + }; + + setup(() => { + sandbox = sinon.createSandbox(); + }); + + teardown(() => { + sandbox.restore(); + }); + + suite('refreshEndpoints', () => { + setup(() => { + sandbox.stub(stripeDaemon, 'setupClient').resolves(daemonClient); + }); + + test('get all endpoints successfully', async () => { + const stripeWebhooksView = new StripeWebhooksViewProvider(stripeDaemon); + + const endpointData1 = new WebhookEndpointsListResponse.WebhookEndpointData(); + endpointData1.setUrl('http://endpoints1.com'); + const endpointData2 = new WebhookEndpointsListResponse.WebhookEndpointData(); + endpointData2.setUrl('http://endpoints2.com'); + + const mockEndpointsResponse = new WebhookEndpointsListResponse(); + mockEndpointsResponse.setEndpointsList([endpointData1, endpointData2]); + + sandbox + .stub(daemonClient, 'webhookEndpointsList') + .value( + ( + req: WebhookEndpointsListRequest, + callback: (error: grpc.ServiceError | null, res: WebhookEndpointsListResponse) => void, + ) => { + callback(null, mockEndpointsResponse); + }, + ); + + await stripeWebhooksView.refreshEndpoints(); + const endpointItems = stripeWebhooksView.getEndpoints(); + + assert.deepStrictEqual(endpointItems.length, 2); + }); + + test('failed to get endpoints', async () => { + const stripeWebhooksView = new StripeWebhooksViewProvider(stripeDaemon); + const errorMessage = 'Something went wrong'; + const error = {details: errorMessage}; + + const errorSpy = sandbox.spy(vscode.window, 'showErrorMessage'); + + sandbox + .stub(daemonClient, 'webhookEndpointsList') + .value( + ( + req: WebhookEndpointsListRequest, + callback: (error: grpc.ServiceError | null, res: WebhookEndpointsListResponse) => void, + ) => { + callback(error, new WebhookEndpointsListResponse()); + }, + ); + + await stripeWebhooksView.refreshEndpoints(); + const endpointItems = stripeWebhooksView.getEndpoints(); + + assert.deepStrictEqual(endpointItems.length, 0); + assert.deepStrictEqual(errorSpy.calledWith(sinon.match(errorMessage)), true); + }); + }); +}); From 7ca14dae5e4087ec94e5264a45c0af53f32fe760 Mon Sep 17 00:00:00 2001 From: Evelyn Tsai Date: Tue, 30 Nov 2021 15:26:23 -0800 Subject: [PATCH 2/2] show enabled webhook endpoints only --- src/stripeWebhooksView.ts | 32 ++++++++++++--------------- test/suite/stripeWebhooksView.test.ts | 7 +++++- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/stripeWebhooksView.ts b/src/stripeWebhooksView.ts index 44f89981..78eb8251 100644 --- a/src/stripeWebhooksView.ts +++ b/src/stripeWebhooksView.ts @@ -30,7 +30,6 @@ export class StripeWebhooksViewProvider extends StripeTreeViewDataProvider { if (this.endpointItems.length > 0) { const endpointsRootItem = new StripeTreeItem('All webhook endpoints'); endpointsRootItem.children = this.endpointItems; - endpointsRootItem.expand(); endpointsRootItem.makeCollapsible(); items.push(endpointsRootItem); } @@ -54,25 +53,22 @@ export class StripeWebhooksViewProvider extends StripeTreeViewDataProvider { } else if (response) { const endpoints = response.getEndpointsList(); if (endpoints.length > 0) { - const endpointItems = endpoints.map((e) => { - const enabledEventsRootItem = new StripeTreeItem('Enabled events'); - const enabledEvents = e.getEnabledeventsList(); - enabledEventsRootItem.children = enabledEvents.map( - (event) => new StripeTreeItem(event), - ); - enabledEventsRootItem.expand(); - enabledEventsRootItem.makeCollapsible(); + const endpointItems = endpoints + .filter((e) => e.getStatus() === 'enabled') + .map((e) => { + const enabledEventsRootItem = new StripeTreeItem('Enabled events'); + const enabledEvents = e.getEnabledeventsList(); + enabledEventsRootItem.children = enabledEvents.map( + (event) => new StripeTreeItem(event), + ); + enabledEventsRootItem.makeCollapsible(); - const endpointItem = new StripeTreeItem(e.getUrl()); - endpointItem.children = [ - new StripeTreeItem(`Status: ${e.getStatus()}`), - enabledEventsRootItem, - ]; - endpointItem.expand(); - endpointItem.makeCollapsible(); + const endpointItem = new StripeTreeItem(e.getUrl()); + endpointItem.children = [enabledEventsRootItem]; + endpointItem.makeCollapsible(); - return endpointItem; - }); + return endpointItem; + }); this.endpointItems = endpointItems; this.refresh(); } diff --git a/test/suite/stripeWebhooksView.test.ts b/test/suite/stripeWebhooksView.test.ts index 52008b26..f7017562 100644 --- a/test/suite/stripeWebhooksView.test.ts +++ b/test/suite/stripeWebhooksView.test.ts @@ -45,11 +45,16 @@ suite('stripeWebhooksView', () => { const endpointData1 = new WebhookEndpointsListResponse.WebhookEndpointData(); endpointData1.setUrl('http://endpoints1.com'); + endpointData1.setStatus('disabled'); const endpointData2 = new WebhookEndpointsListResponse.WebhookEndpointData(); endpointData2.setUrl('http://endpoints2.com'); + endpointData2.setStatus('enabled'); + const endpointData3 = new WebhookEndpointsListResponse.WebhookEndpointData(); + endpointData3.setUrl('http://endpoints3.com'); + endpointData3.setStatus('enabled'); const mockEndpointsResponse = new WebhookEndpointsListResponse(); - mockEndpointsResponse.setEndpointsList([endpointData1, endpointData2]); + mockEndpointsResponse.setEndpointsList([endpointData1, endpointData2, endpointData3]); sandbox .stub(daemonClient, 'webhookEndpointsList')