Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list all webhook endpoints #469

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
"name": "Logs",
"when": "stripe.isNotCLIInstalled == false"
},
{
"id": "stripeWebhooksView",
"name": "Webhooks",
"when": "stripe.isNotCLIInstalled == false"
},
{
"id": "stripeSamplesView",
"name": "Samples",
Expand Down
8 changes: 8 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
281 changes: 70 additions & 211 deletions src/rpc/commands_grpc_pb.d.ts

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions src/rpc/commands_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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);
5 changes: 2 additions & 3 deletions src/rpc/commands_pb.d.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";

2 changes: 2 additions & 0 deletions src/rpc/commands_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
139 changes: 71 additions & 68 deletions src/rpc/common_pb.d.ts
Original file line number Diff line number Diff line change
@@ -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<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
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<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
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<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
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<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
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,
}
}
}

Loading