Skip to content

Commit

Permalink
yarn build:esm
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Jan 27, 2025
1 parent 2a10918 commit a4c821f
Show file tree
Hide file tree
Showing 952 changed files with 3,341 additions and 3,936 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test"
],
"scripts": {
"compile": "lerna exec tsc --no-private && lerna exec 'cp -r src lib' --no-private",
"build:cjs": "lerna exec 'tsc --module CommonJS --outDir lib/cjs' --no-private",
"build:esm": "lerna exec 'tsc --module NodeNext --outDir lib/esm --declaration true' --no-private",
"prepublishOnly": "yarn reset && yarn compile",
"reset": "lerna exec 'rm -rf lib' && yarn delete-js",
"test": "yarn workspace @rc-ex/test run vitest",
Expand Down
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"author": "Tyler Liu <[email protected]>",
"homepage": "https://github.com/ringcentral/ringcentral-extensible/tree/master/packages/core",
"license": "MIT",
"main": "src/index.js",
"types": "src/index.d.ts",
"type": "module",
"types": "./lib/esm/index.d.ts",
"main": "./lib/cjs/index.cjs",
"module": "./lib/esm/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/ringcentral/ringcentral-extensible.git"
Expand Down
12 changes: 8 additions & 4 deletions packages/core/src/FormData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Stream } from "stream";

import type { FormFile } from "./types";
import type { FormFile } from "./types.js";

async function stream2buffer(stream: Stream): Promise<Buffer> {
return new Promise<Buffer>((resolve, reject) => {
Expand Down Expand Up @@ -38,12 +38,16 @@ class FormData {
if (typeof formFile.content === "string") {
fileBuffer = Buffer.from(`${formFile.content}\r\n`, "utf-8");
} else if (Buffer.isBuffer(formFile.content)) {
fileBuffer = formFile.content;
fileBuffer = formFile.content as Buffer<ArrayBuffer>;
} else if (formFile.content instanceof Blob) {
fileBuffer = Buffer.from(await formFile.content.arrayBuffer());
fileBuffer = Buffer.from(
await formFile.content.arrayBuffer(),
) as Buffer<ArrayBuffer>;
} else {
// NodeJS.ReadableStream
fileBuffer = await stream2buffer(formFile.content as unknown as Stream);
fileBuffer = await stream2buffer(
formFile.content as unknown as Stream,
) as Buffer<ArrayBuffer>;
}
buffer = Buffer.concat([buffer, fileBuffer]);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/Rest.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { AxiosInstance } from "axios";
import axios from "axios";
import qs from "qs";
import { boundary } from "./FormData";
import { boundary } from "./FormData.js";

import RestException from "./RestException";
import type TokenInfo from "./definitions/TokenInfo";
import RestException from "./RestException.js";
import type TokenInfo from "./definitions/TokenInfo.js";
import type {
RestMethod,
RestOptions,
RestRequestConfig,
RestResponse,
} from "./types";
} from "./types.js";

const version = "1.5.0";

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/RestException.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RestResponse } from "./types";
import Utils from "./Utils";
import type { RestResponse } from "./types.js";
import Utils from "./Utils.js";

class RestException extends Error {
public response: RestResponse;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/SdkExtension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RingCentralInterface } from "./types";
import type { RingCentralInterface } from "./types.js";

abstract class SdkExtension {
public enabled = true;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FormData from "./FormData";
import FormData from "./FormData.js";

import type Attachment from "./definitions/Attachment";
import type { RestResponse } from "./types";
import type Attachment from "./definitions/Attachment.js";
import type { RestResponse } from "./types.js";

class Utils {
public static formatTraffic(r: RestResponse): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/ADGErrorResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ADGError from "./ADGError";
import ADGError from "./ADGError.js";

/**
* Format of response in case that any error occurred during request processing
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/definitions/AIInsights.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type TranscriptInsightUnit from "./TranscriptInsightUnit";
import type SummaryInsightUnit from "./SummaryInsightUnit";
import type HighlightsInsightUnit from "./HighlightsInsightUnit";
import type NextStepsInsightUnit from "./NextStepsInsightUnit";
import type BulletedSummaryInsightUnit from "./BulletedSummaryInsightUnit";
import type AIScoreInsightUnit from "./AIScoreInsightUnit";
import TranscriptInsightUnit from "./TranscriptInsightUnit.js";
import SummaryInsightUnit from "./SummaryInsightUnit.js";
import HighlightsInsightUnit from "./HighlightsInsightUnit.js";
import NextStepsInsightUnit from "./NextStepsInsightUnit.js";
import BulletedSummaryInsightUnit from "./BulletedSummaryInsightUnit.js";
import AIScoreInsightUnit from "./AIScoreInsightUnit.js";

interface AIInsights {
/** */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/APNSInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type APSInfo from "./APSInfo";
import APSInfo from "./APSInfo.js";

/**
* APNS (Apple Push Notification Service) information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ContactBusinessAddressInfo from "./ContactBusinessAddressInfo";
import ContactBusinessAddressInfo from "./ContactBusinessAddressInfo.js";

interface AccountBusinessAddressResource {
/**
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/definitions/AccountDeviceUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type EmergencyServiceAddressResourceRequest from "./EmergencyServiceAddressResourceRequest";
import type DeviceEmergencyInfo from "./DeviceEmergencyInfo";
import type DeviceUpdateExtensionInfo from "./DeviceUpdateExtensionInfo";
import type DeviceUpdatePhoneLinesInfo from "./DeviceUpdatePhoneLinesInfo";
import EmergencyServiceAddressResourceRequest from "./EmergencyServiceAddressResourceRequest.js";
import DeviceEmergencyInfo from "./DeviceEmergencyInfo.js";
import DeviceUpdateExtensionInfo from "./DeviceUpdateExtensionInfo.js";
import DeviceUpdatePhoneLinesInfo from "./DeviceUpdatePhoneLinesInfo.js";

interface AccountDeviceUpdate {
/** */
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/definitions/AccountHistoryPublicRecord.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type AccountHistoryRecordPublicInitiator from "./AccountHistoryRecordPublicInitiator";
import type AccountHistoryRecordTarget from "./AccountHistoryRecordTarget";
import type AccountHistoryRecordPublicDetails from "./AccountHistoryRecordPublicDetails";
import AccountHistoryRecordPublicInitiator from "./AccountHistoryRecordPublicInitiator.js";
import AccountHistoryRecordTarget from "./AccountHistoryRecordTarget.js";
import AccountHistoryRecordPublicDetails from "./AccountHistoryRecordPublicDetails.js";

interface AccountHistoryPublicRecord {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AccountHistoryRecordDetailsParameters from "./AccountHistoryRecordDetailsParameters";
import AccountHistoryRecordDetailsParameters from "./AccountHistoryRecordDetailsParameters.js";

interface AccountHistoryRecordPublicDetails {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type AccountHistoryPublicRecord from "./AccountHistoryPublicRecord";
import type AccountHistoryPaging from "./AccountHistoryPaging";
import AccountHistoryPublicRecord from "./AccountHistoryPublicRecord.js";
import AccountHistoryPaging from "./AccountHistoryPaging.js";

interface AccountHistorySearchPublicResponse {
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/definitions/AccountInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type PostalAddress from "./PostalAddress";
import type ServiceInfoV2 from "./ServiceInfoV2";
import type SystemUserContactInfo from "./SystemUserContactInfo";
import PostalAddress from "./PostalAddress.js";
import ServiceInfoV2 from "./ServiceInfoV2.js";
import SystemUserContactInfo from "./SystemUserContactInfo.js";

interface AccountInfo {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/AccountLockedSettingResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type ScheduleMeetingResponse from "./ScheduleMeetingResponse";
import type AccountLockSettingRecordResponse from "./AccountLockSettingRecordResponse";
import ScheduleMeetingResponse from "./ScheduleMeetingResponse.js";
import AccountLockSettingRecordResponse from "./AccountLockSettingRecordResponse.js";

interface AccountLockedSettingResponse {
/** */
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/AccountPhoneNumberInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type ContactCenterProvider from "./ContactCenterProvider";
import type AccountPhoneNumberInfoExtension from "./AccountPhoneNumberInfoExtension";
import ContactCenterProvider from "./ContactCenterProvider.js";
import AccountPhoneNumberInfoExtension from "./AccountPhoneNumberInfoExtension.js";

interface AccountPhoneNumberInfo {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/AccountPhoneNumberList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type AccountPhoneNumberInfo from "./AccountPhoneNumberInfo";
import type EnumeratedPagingModel from "./EnumeratedPagingModel";
import AccountPhoneNumberInfo from "./AccountPhoneNumberInfo.js";
import EnumeratedPagingModel from "./EnumeratedPagingModel.js";

interface AccountPhoneNumberList {
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/definitions/AccountPhoneNumbers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type CompanyPhoneNumberInfo from "./CompanyPhoneNumberInfo";
import type PageNavigationModel from "./PageNavigationModel";
import type EnumeratedPagingModel from "./EnumeratedPagingModel";
import CompanyPhoneNumberInfo from "./CompanyPhoneNumberInfo.js";
import PageNavigationModel from "./PageNavigationModel.js";
import EnumeratedPagingModel from "./EnumeratedPagingModel.js";

interface AccountPhoneNumbers {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AccountPresenceEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AccountPresenceEventBody from "./AccountPresenceEventBody";
import AccountPresenceEventBody from "./AccountPresenceEventBody.js";

interface AccountPresenceEvent {
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/definitions/AccountPresenceInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type GetPresenceInfo from "./GetPresenceInfo";
import type PresenceNavigationInfo from "./PresenceNavigationInfo";
import type PresencePagingInfo from "./PresencePagingInfo";
import GetPresenceInfo from "./GetPresenceInfo.js";
import PresenceNavigationInfo from "./PresenceNavigationInfo.js";
import PresencePagingInfo from "./PresencePagingInfo.js";

interface AccountPresenceInfo {
/**
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/definitions/AccountRegionalSettings.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type CountryInfoShortModel from "./CountryInfoShortModel";
import type TimezoneInfo from "./TimezoneInfo";
import type RegionalLanguageInfo from "./RegionalLanguageInfo";
import type GreetingLanguageInfo from "./GreetingLanguageInfo";
import type FormattingLocaleInfo from "./FormattingLocaleInfo";
import type CurrencyInfo from "./CurrencyInfo";
import CountryInfoShortModel from "./CountryInfoShortModel.js";
import TimezoneInfo from "./TimezoneInfo.js";
import RegionalLanguageInfo from "./RegionalLanguageInfo.js";
import GreetingLanguageInfo from "./GreetingLanguageInfo.js";
import FormattingLocaleInfo from "./FormattingLocaleInfo.js";
import CurrencyInfo from "./CurrencyInfo.js";

/**
* Account level region data (web service Auto-Receptionist settings)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AccountResource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type PhoneNumberResource from "./PhoneNumberResource";
import PhoneNumberResource from "./PhoneNumberResource.js";

interface AccountResource {
/**
Expand Down
18 changes: 9 additions & 9 deletions packages/core/src/definitions/AccountServiceInfo.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type BrandInfo from "./BrandInfo";
import type CountryInfoShortModel from "./CountryInfoShortModel";
import type ServicePlanInfo from "./ServicePlanInfo";
import type TargetServicePlanInfo from "./TargetServicePlanInfo";
import type BillingPlanInfo from "./BillingPlanInfo";
import type ServiceFeatureInfo from "./ServiceFeatureInfo";
import type AccountLimits from "./AccountLimits";
import type BillingPackageInfo from "./BillingPackageInfo";
import type UBrandInfo from "./UBrandInfo";
import BrandInfo from "./BrandInfo.js";
import CountryInfoShortModel from "./CountryInfoShortModel.js";
import ServicePlanInfo from "./ServicePlanInfo.js";
import TargetServicePlanInfo from "./TargetServicePlanInfo.js";
import BillingPlanInfo from "./BillingPlanInfo.js";
import ServiceFeatureInfo from "./ServiceFeatureInfo.js";
import AccountLimits from "./AccountLimits.js";
import BillingPackageInfo from "./BillingPackageInfo.js";
import UBrandInfo from "./UBrandInfo.js";

/**
* Account service information, including brand, service plan and billing plan
Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/definitions/AccountServiceInfoRequest.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type BrandInfo from "./BrandInfo";
import type CountryInfoShortModel from "./CountryInfoShortModel";
import type ServicePlanInfo from "./ServicePlanInfo";
import type TargetServicePlanInfo from "./TargetServicePlanInfo";
import type BillingPlanInfo from "./BillingPlanInfo";
import type ServiceFeatureInfo from "./ServiceFeatureInfo";
import type AccountLimits from "./AccountLimits";
import type BillingPackageInfo from "./BillingPackageInfo";
import BrandInfo from "./BrandInfo.js";
import CountryInfoShortModel from "./CountryInfoShortModel.js";
import ServicePlanInfo from "./ServicePlanInfo.js";
import TargetServicePlanInfo from "./TargetServicePlanInfo.js";
import BillingPlanInfo from "./BillingPlanInfo.js";
import ServiceFeatureInfo from "./ServiceFeatureInfo.js";
import AccountLimits from "./AccountLimits.js";
import BillingPackageInfo from "./BillingPackageInfo.js";

/**
* Account service information, including brand, service plan and billing plan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type TelephonySessionsEventBody from "./TelephonySessionsEventBody";
import TelephonySessionsEventBody from "./TelephonySessionsEventBody.js";

interface AccountTelephonySessionsEvent {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/ActionAdaptiveCardInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ActionCardBody from "./ActionCardBody";
import ActionCardBody from "./ActionCardBody.js";

interface ActionAdaptiveCardInfo {
/** */
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/ActiveCallInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type DetailedCallInfo from "./DetailedCallInfo";
import type CallInfoCQ from "./CallInfoCQ";
import DetailedCallInfo from "./DetailedCallInfo.js";
import CallInfoCQ from "./CallInfoCQ.js";

interface ActiveCallInfo {
/** */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/ActiveCallInfoWithoutSIP.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type CallInfoCQ from "./CallInfoCQ";
import CallInfoCQ from "./CallInfoCQ.js";

interface ActiveCallInfoWithoutSIP {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/ActivePermissionResource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type PermissionIdResource from "./PermissionIdResource";
import type RoleIdResource from "./RoleIdResource";
import PermissionIdResource from "./PermissionIdResource.js";
import RoleIdResource from "./RoleIdResource.js";

interface ActivePermissionResource {
/** */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AdaptiveCardAction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ActionAdaptiveCardInfo from "./ActionAdaptiveCardInfo";
import ActionAdaptiveCardInfo from "./ActionAdaptiveCardInfo.js";

interface AdaptiveCardAction {
/** */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AdaptiveCardColumnInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AdaptiveCardColumnItemInfo from "./AdaptiveCardColumnItemInfo";
import AdaptiveCardColumnItemInfo from "./AdaptiveCardColumnItemInfo.js";

interface AdaptiveCardColumnInfo {
/** */
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/definitions/AdaptiveCardInfo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type AdaptiveCardCreator from "./AdaptiveCardCreator";
import type AdaptiveCardInfoRequest from "./AdaptiveCardInfoRequest";
import type AdaptiveCardAction from "./AdaptiveCardAction";
import type AdaptiveCardSelectAction from "./AdaptiveCardSelectAction";
import type BackgroundImage from "./BackgroundImage";
import AdaptiveCardCreator from "./AdaptiveCardCreator.js";
import AdaptiveCardInfoRequest from "./AdaptiveCardInfoRequest.js";
import AdaptiveCardAction from "./AdaptiveCardAction.js";
import AdaptiveCardSelectAction from "./AdaptiveCardSelectAction.js";
import BackgroundImage from "./BackgroundImage.js";

interface AdaptiveCardInfo {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AdaptiveCardInfoRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AdaptiveCardInfoRequestItem from "./AdaptiveCardInfoRequestItem";
import AdaptiveCardInfoRequestItem from "./AdaptiveCardInfoRequestItem.js";

interface AdaptiveCardInfoRequest {
/** */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AdaptiveCardColumnInfo from "./AdaptiveCardColumnInfo";
import AdaptiveCardColumnInfo from "./AdaptiveCardColumnInfo.js";

interface AdaptiveCardInfoRequestItem {
/** */
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/definitions/AdaptiveCardRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type AdaptiveCardInfoRequest from "./AdaptiveCardInfoRequest";
import type AdaptiveCardAction from "./AdaptiveCardAction";
import type AdaptiveCardSelectAction from "./AdaptiveCardSelectAction";
import type BackgroundImage from "./BackgroundImage";
import AdaptiveCardInfoRequest from "./AdaptiveCardInfoRequest.js";
import AdaptiveCardAction from "./AdaptiveCardAction.js";
import AdaptiveCardSelectAction from "./AdaptiveCardSelectAction.js";
import BackgroundImage from "./BackgroundImage.js";

interface AdaptiveCardRequest {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/AdaptiveCardShortInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AdaptiveCardCreator from "./AdaptiveCardCreator";
import AdaptiveCardCreator from "./AdaptiveCardCreator.js";

interface AdaptiveCardShortInfo {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type AddDeviceToInventoryRequestSite from "./AddDeviceToInventoryRequestSite";
import AddDeviceToInventoryRequestSite from "./AddDeviceToInventoryRequestSite.js";

interface AddDeviceToInventoryRequest {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/definitions/AddDeviceToInventoryResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type AddDeviceToInventoryResponseDevices from "./AddDeviceToInventoryResponseDevices";
import type SiteBasicInfo from "./SiteBasicInfo";
import AddDeviceToInventoryResponseDevices from "./AddDeviceToInventoryResponseDevices.js";
import SiteBasicInfo from "./SiteBasicInfo.js";

interface AddDeviceToInventoryResponse {
/**
Expand Down
Loading

0 comments on commit a4c821f

Please sign in to comment.