This repository was archived by the owner on Dec 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +114
-16
lines changed Expand file tree Collapse file tree 13 files changed +114
-16
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ export interface ServerlessCommand {
8888 commands ?: ServerlessCommandMap ;
8989}
9090
91+ export interface ServerlessHookMap {
92+ [ eventName : string ] : Promise < any > ;
93+ }
94+
9195export interface ServerlessCommandMap {
9296 [ command : string ] : ServerlessCommand ;
9397}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { ApimService } from "../../services/apimService";
33import { AzureBasePlugin } from "../azureBasePlugin" ;
44
55export class AzureApimFunctionPlugin extends AzureBasePlugin {
6- public hooks : { [ eventName : string ] : Promise < any > } ;
76
87 public constructor ( serverless : Serverless , options : Serverless . Options ) {
98 super ( serverless , options ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { ApimService } from "../../services/apimService";
33import { AzureBasePlugin } from "../azureBasePlugin" ;
44
55export class AzureApimServicePlugin extends AzureBasePlugin {
6- public hooks : { [ eventName : string ] : Promise < any > } ;
76
87 public constructor ( serverless : Serverless , options : Serverless . Options ) {
98 super ( serverless , options ) ;
Original file line number Diff line number Diff line change 11import { Guard } from "../shared/guard" ;
22import Serverless from "serverless" ;
33import { Utils } from "../shared/utils" ;
4+ import { ServerlessCommandMap , ServerlessHookMap } from "../models/serverless" ;
45
56export abstract class AzureBasePlugin < TOptions = Serverless . Options > {
7+
8+ public hooks : ServerlessHookMap
9+ protected commands : ServerlessCommandMap ;
10+
611 public constructor (
712 protected serverless : Serverless ,
813 protected options : TOptions ,
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { ResourceService } from "../../services/resourceService";
66import { AzureBasePlugin } from "../azureBasePlugin" ;
77
88export class AzureDeployPlugin extends AzureBasePlugin < AzureLoginOptions > {
9- public hooks : { [ eventName : string ] : Promise < any > } ;
109 public commands : any ;
1110
1211 public constructor ( serverless : Serverless , options : AzureLoginOptions ) {
@@ -25,13 +24,39 @@ export class AzureDeployPlugin extends AzureBasePlugin<AzureLoginOptions> {
2524 lifecycleEvents : [
2625 "list"
2726 ]
27+ } ,
28+ options : {
29+ resourceGroup : {
30+ usage : "Resource group for the service" ,
31+ shortcut : "g" ,
32+ } ,
33+ stage : {
34+ usage : "Stage of service" ,
35+ shortcut : "s"
36+ } ,
37+ region : {
38+ usage : "Region of service" ,
39+ shortcut : "r"
40+ } ,
41+ subscriptionId : {
42+ usage : "Sets the Azure subscription ID" ,
43+ shortcut : "i" ,
44+ } ,
2845 }
2946 } ,
3047 options : {
3148 resourceGroup : {
3249 usage : "Resource group for the service" ,
3350 shortcut : "g" ,
3451 } ,
52+ stage : {
53+ usage : "Stage of service" ,
54+ shortcut : "s"
55+ } ,
56+ region : {
57+ usage : "Region of service" ,
58+ shortcut : "r"
59+ } ,
3560 subscriptionId : {
3661 usage : "Sets the Azure subscription ID" ,
3762 shortcut : "i" ,
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { FuncService } from "../../services/funcService";
33import { AzureBasePlugin } from "../azureBasePlugin" ;
44
55export class AzureFuncPlugin extends AzureBasePlugin {
6- public hooks : { [ eventName : string ] : Promise < any > } ;
7- public commands : any ;
86 private service : FuncService ;
97
108 public constructor ( serverless : Serverless , options : Serverless . Options ) {
Original file line number Diff line number Diff line change 1+ import fs from "fs" ;
12import { isAbsolute , join } from "path" ;
23import Serverless from "serverless" ;
34import { InvokeService } from "../../services/invokeService" ;
4- import fs from "fs" ;
5- import { ServerlessCommandMap } from "../../models/serverless" ;
65import { AzureBasePlugin } from "../azureBasePlugin" ;
76
87export class AzureInvokePlugin extends AzureBasePlugin {
9- public hooks : { [ eventName : string ] : Promise < any > } ;
10- private commands : ServerlessCommandMap ;
8+
119 private invokeService : InvokeService ;
10+
1211 public constructor ( serverless : Serverless , options : Serverless . Options ) {
1312 super ( serverless , options ) ;
1413 const path = this . options [ "path" ] ;
@@ -31,6 +30,22 @@ export class AzureInvokePlugin extends AzureBasePlugin {
3130 usage : "Invoke command" ,
3231 lifecycleEvents : [ "invoke" ] ,
3332 options : {
33+ resourceGroup : {
34+ usage : "Resource group for the service" ,
35+ shortcut : "g" ,
36+ } ,
37+ stage : {
38+ usage : "Stage of service" ,
39+ shortcut : "s"
40+ } ,
41+ region : {
42+ usage : "Region of service" ,
43+ shortcut : "r"
44+ } ,
45+ subscriptionId : {
46+ usage : "Sets the Azure subscription ID" ,
47+ shortcut : "i" ,
48+ } ,
3449 function : {
3550 usage : "Function to call" ,
3651 shortcut : "f" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { AzureBasePlugin } from "../azureBasePlugin";
44import { loginHooks } from "./loginHooks" ;
55
66export class AzureLoginPlugin extends AzureBasePlugin < AzureLoginOptions > {
7- public hooks : { [ eventName : string ] : Promise < any > } ;
87
98 public constructor ( serverless : Serverless , options : AzureLoginOptions ) {
109 super ( serverless , options ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import AzureProvider from "../../provider/azureProvider";
33import { AzureBasePlugin } from "../azureBasePlugin" ;
44
55export class AzureLogsPlugin extends AzureBasePlugin {
6- public hooks : { [ eventName : string ] : Promise < any > } ;
76
87 private provider : AzureProvider ;
98
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { OfflineService } from "../../services/offlineService";
33import { AzureBasePlugin } from "../azureBasePlugin" ;
44
55export class AzureOfflinePlugin extends AzureBasePlugin {
6- public hooks : { [ eventName : string ] : Promise < any > } ;
7- public commands : any ;
86 private offlineService : OfflineService ;
97
108 public constructor ( serverless : Serverless , options : Serverless . Options ) {
You can’t perform that action at this time.
0 commit comments