@daocloud-proto/ghippo 0.42.2 → 0.42.3-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/v1alpha1/sms.pb.ts +58 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/ghippo",
3
- "version":"0.42.2",
3
+ "version":"0.42.3-rc1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -12,6 +12,11 @@ export enum Scene {
12
12
  ChangePhone = "ChangePhone",
13
13
  }
14
14
 
15
+ export enum SmsTemplateStatus {
16
+ StatusDisable = "StatusDisable",
17
+ StatusEnable = "StatusEnable",
18
+ }
19
+
15
20
  export type SendVerificationCodeRequest = {
16
21
  phone?: string
17
22
  countryCode?: string
@@ -32,6 +37,50 @@ export type SendTemplateSmsRequest = {
32
37
  export type SendTemplateSmsResponse = {
33
38
  }
34
39
 
40
+ export type CreateSmsTemplateRequest = {
41
+ template?: string
42
+ domain?: string
43
+ channel?: string
44
+ channelTemplate?: string
45
+ }
46
+
47
+ export type CreateSmsTemplateResponse = {
48
+ }
49
+
50
+ export type ListSmsTemplateRequest = {
51
+ template?: string
52
+ domain?: string
53
+ channel?: string
54
+ channelTemplate?: string
55
+ }
56
+
57
+ export type SmsTemplate = {
58
+ id?: number
59
+ template?: string
60
+ domain?: string
61
+ channel?: string
62
+ channelTemplate?: string
63
+ enable?: SmsTemplateStatus
64
+ }
65
+
66
+ export type ListSmsTemplateResponse = {
67
+ items?: SmsTemplate[]
68
+ }
69
+
70
+ export type BatchTemplate = {
71
+ template?: string
72
+ channelTemplate?: string
73
+ }
74
+
75
+ export type BatchCreateSmsTemplatesByDomainRequest = {
76
+ templates?: BatchTemplate[]
77
+ domain?: string
78
+ channel?: string
79
+ }
80
+
81
+ export type BatchCreateSmsTemplatesByDomainResponse = {
82
+ }
83
+
35
84
  export class Sms {
36
85
  static SendVerificationCode(req: SendVerificationCodeRequest, initReq?: fm.InitReq): Promise<SendVerificationCodeResponse> {
37
86
  return fm.fetchReq<SendVerificationCodeRequest, SendVerificationCodeResponse>(`/apis/ghippo.io/v1alpha1/sms/verification`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -39,4 +88,13 @@ export class Sms {
39
88
  static SendTemplateSms(req: SendTemplateSmsRequest, initReq?: fm.InitReq): Promise<SendTemplateSmsResponse> {
40
89
  return fm.fetchReq<SendTemplateSmsRequest, SendTemplateSmsResponse>(`/v1alpha1.sms.Sms/SendTemplateSms`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
41
90
  }
91
+ static ListSmsTemplate(req: ListSmsTemplateRequest, initReq?: fm.InitReq): Promise<ListSmsTemplateResponse> {
92
+ return fm.fetchReq<ListSmsTemplateRequest, ListSmsTemplateResponse>(`/apis/ghippo.io/v1alpha1/sms/template?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
93
+ }
94
+ static CreateSmsTemplate(req: CreateSmsTemplateRequest, initReq?: fm.InitReq): Promise<CreateSmsTemplateResponse> {
95
+ return fm.fetchReq<CreateSmsTemplateRequest, CreateSmsTemplateResponse>(`/apis/ghippo.io/v1alpha1/sms/template`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
96
+ }
97
+ static BatchCreateSmsTemplatesByDomain(req: BatchCreateSmsTemplatesByDomainRequest, initReq?: fm.InitReq): Promise<BatchCreateSmsTemplatesByDomainResponse> {
98
+ return fm.fetchReq<BatchCreateSmsTemplatesByDomainRequest, BatchCreateSmsTemplatesByDomainResponse>(`/apis/ghippo.io/v1alpha1/sms/template/batch-by-domain`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
99
+ }
42
100
  }