This commit is contained in:
wkj 2023-11-27 13:54:14 +08:00
parent 265b481850
commit c8949de48d
15 changed files with 203 additions and 0 deletions

24
es/service/ali/Sms.native.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
type SendSmsRequest = {
PhoneNumbers: string[];
TemplateCode: string;
SignName: string;
TemplateParam?: Record<string, string>;
SmsUpExtendCode?: string;
OutId?: string;
};
type SendSmsResponse = {
Code: 'OK' | string;
Message: string;
BizId: string;
RequestId: string;
};
export declare class AliSmsInstance {
secretId: string;
secretKey: string;
region: string;
endpoint: string;
client: any;
constructor(secretId: string, secretKey: string, region: string, endpoint: string);
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
}
export {};

View File

@ -0,0 +1,29 @@
export class AliSmsInstance {
secretId;
secretKey;
region;
endpoint;
client;
constructor(secretId, secretKey, region, endpoint) {
this.secretId = secretId;
this.secretKey = secretKey;
this.region = region;
this.endpoint = endpoint;
const clientConfig = {
credential: {
secretId: this.secretId,
secretKey: this.secretKey,
},
region: this.region,
profile: {
httpProfile: {
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
},
},
};
}
async sendSms(params) {
console.log('react-native走不到这里');
return {};
}
}

4
es/service/tencent/Sms.native.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
import { SendSmsRequest, SendSmsResponse } from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
export declare class TencentSmsInstance {
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
}

View File

@ -0,0 +1,6 @@
export class TencentSmsInstance {
async sendSms(params) {
console.log('react-native走不到这里');
return {};
}
}

0
es/utils/fetch/index.native.d.ts vendored Normal file
View File

View File

@ -0,0 +1,2 @@
"use strict";
global.fetch = fetch;

24
lib/service/ali/Sms.native.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
type SendSmsRequest = {
PhoneNumbers: string[];
TemplateCode: string;
SignName: string;
TemplateParam?: Record<string, string>;
SmsUpExtendCode?: string;
OutId?: string;
};
type SendSmsResponse = {
Code: 'OK' | string;
Message: string;
BizId: string;
RequestId: string;
};
export declare class AliSmsInstance {
secretId: string;
secretKey: string;
region: string;
endpoint: string;
client: any;
constructor(secretId: string, secretKey: string, region: string, endpoint: string);
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
}
export {};

View File

@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AliSmsInstance = void 0;
class AliSmsInstance {
secretId;
secretKey;
region;
endpoint;
client;
constructor(secretId, secretKey, region, endpoint) {
this.secretId = secretId;
this.secretKey = secretKey;
this.region = region;
this.endpoint = endpoint;
const clientConfig = {
credential: {
secretId: this.secretId,
secretKey: this.secretKey,
},
region: this.region,
profile: {
httpProfile: {
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
},
},
};
}
async sendSms(params) {
console.log('react-native走不到这里');
return {};
}
}
exports.AliSmsInstance = AliSmsInstance;

4
lib/service/tencent/Sms.native.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
import { SendSmsRequest, SendSmsResponse } from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
export declare class TencentSmsInstance {
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
}

View File

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TencentSmsInstance = void 0;
class TencentSmsInstance {
async sendSms(params) {
console.log('react-native走不到这里');
return {};
}
}
exports.TencentSmsInstance = TencentSmsInstance;

0
lib/utils/fetch/index.native.d.ts vendored Normal file
View File

View File

@ -0,0 +1,2 @@
"use strict";
global.fetch = fetch;

View File

@ -0,0 +1,53 @@
type SendSmsRequest = {
PhoneNumbers: string[];
TemplateCode: string;
SignName: string;
TemplateParam?: Record<string, string>;
SmsUpExtendCode?: string;
OutId?: string;
};
type SendSmsResponse = {
Code: 'OK' | string;
Message: string;
BizId: string;
RequestId: string;
};
export class AliSmsInstance {
secretId: string;
secretKey: string;
region: string;
endpoint: string;
client: any;
constructor(
secretId: string,
secretKey: string,
region: string,
endpoint: string
) {
this.secretId = secretId;
this.secretKey = secretKey;
this.region = region;
this.endpoint = endpoint;
const clientConfig = {
credential: {
secretId: this.secretId,
secretKey: this.secretKey,
},
region: this.region,
profile: {
httpProfile: {
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
},
},
};
}
async sendSms(params: SendSmsRequest) {
console.log('react-native走不到这里');
return {} as SendSmsResponse;
}
}

View File

@ -0,0 +1,11 @@
import {
SendSmsRequest,
SendSmsResponse,
} from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
export class TencentSmsInstance {
async sendSms(params: SendSmsRequest) {
console.log('react-native走不到这里');
return {} as SendSmsResponse;
}
}

View File

@ -0,0 +1 @@
global.fetch = fetch;