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

fix: module export #21

Merged
merged 68 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
78284f6
feat(repo): adding npm skel files
neko1101 Nov 8, 2022
bf36cfa
feat(class): core function
neko1101 Nov 8, 2022
091c097
feat(deps): update packages
neko1101 Nov 8, 2022
12dae59
Update README.md
neko1101 Nov 8, 2022
9ecae08
feat(core): finished initial commit
neko1101 Nov 8, 2022
d6bb604
Update tslint.json
neko1101 Nov 8, 2022
332340e
Create npm-publish.yml
neko1101 Nov 8, 2022
aa7a0fb
Update npm-publish.yml
neko1101 Nov 8, 2022
6b97faf
Merge branch 'main' into develop
neko1101 Nov 8, 2022
c2fd316
Merge branch 'main' into develop
neko1101 Nov 8, 2022
53df303
Update package.json
neko1101 Nov 8, 2022
bff28dc
Update package.json
neko1101 Nov 8, 2022
cd48441
Update package-lock.json
neko1101 Nov 8, 2022
b5ac8b8
Update npm-publish.yml
neko1101 Nov 8, 2022
40d23f8
Update README.md
neko1101 Nov 9, 2022
ad38c44
chore: remove test package
neko1101 Nov 9, 2022
7d54d91
Update package.json
neko1101 Nov 9, 2022
219542a
Merge branch 'main' into develop
neko1101 Nov 9, 2022
2eb07dc
Merge branch 'main' into develop
neko1101 Nov 9, 2022
8322d4d
Update package.json
neko1101 Nov 9, 2022
986a7fc
feat(test): added jest test and test ci
neko1101 Nov 9, 2022
0dc687a
chore(deps): update package
neko1101 Nov 9, 2022
cfeabbd
chore(core): refactored
neko1101 Nov 9, 2022
058bb02
Merge branch 'main' into develop
neko1101 Nov 9, 2022
8ce8911
chore(test): fix error
neko1101 Nov 9, 2022
51c54cd
Update tsconfig.json
neko1101 Nov 9, 2022
c27fa26
Update tsconfig.json
neko1101 Nov 9, 2022
617f503
Update package.json
neko1101 Nov 9, 2022
c289a62
Merge branch 'main' into develop
neko1101 Nov 9, 2022
51be31e
Update tsconfig.json
neko1101 Nov 9, 2022
286c6ac
Update jest-test.yml
neko1101 Nov 9, 2022
db5709f
Update jest-test.yml
neko1101 Nov 9, 2022
7304812
Update index.test.ts
neko1101 Nov 9, 2022
2058d48
Update jest-test.yml
neko1101 Nov 9, 2022
91e8194
Update jest-test.yml
neko1101 Nov 9, 2022
f21f82d
Update jest-test.yml
neko1101 Nov 9, 2022
228c89c
Update jest-test.yml
neko1101 Nov 9, 2022
72f76a8
Update jest-test.yml
neko1101 Nov 9, 2022
6082771
Update jest-test.yml
neko1101 Nov 9, 2022
4eee1e3
chore(workflows): updated ci
neko1101 Nov 10, 2022
a78ab5d
Update jest-test.yml
neko1101 Nov 10, 2022
051de8e
Update jest-test.yml
neko1101 Nov 10, 2022
5d967d9
chore(workflows): add coverage
neko1101 Nov 10, 2022
41a30c5
Update jest-test.yml
neko1101 Nov 10, 2022
a49bad8
Update jest-test.yml
neko1101 Nov 10, 2022
cb9461c
Update jest-test.yml
neko1101 Nov 10, 2022
6406a84
Update jest-test.yml
neko1101 Nov 10, 2022
eeb2865
feat(workflow): separate coverage ci
neko1101 Nov 10, 2022
af15665
Update index.test.ts
neko1101 Nov 10, 2022
8f68b19
Create CODE_OF_CONDUCT.md
neko1101 Nov 10, 2022
90bdf6a
Update package.json
neko1101 Nov 10, 2022
baaf1e8
Update README.md
neko1101 Nov 10, 2022
29103d6
Update index.ts
neko1101 Nov 10, 2022
6bd6706
Merge branch 'main' into develop
neko1101 Nov 10, 2022
b60024f
Update npm-publish.yml
neko1101 Nov 10, 2022
779a341
Update package.json
neko1101 Nov 10, 2022
1b49bfc
fix: exclude dist file on test
neko1101 Nov 10, 2022
9313047
Merge branch 'main' into develop
neko1101 Nov 10, 2022
09f0efe
Merge branch 'main' into develop
neko1101 Nov 10, 2022
a6d21e7
bump: v0.0.8
neko1101 Nov 10, 2022
7ebb958
Merge branch 'main' into develop
neko1101 Nov 10, 2022
9093b63
bump: version 0.1.0
neko1101 Nov 10, 2022
b8b6911
fix: package.json
neko1101 Nov 10, 2022
a926ea1
Merge branch 'main' into develop
neko1101 Nov 10, 2022
e7d36e0
Merge branch 'main' into develop
neko1101 Nov 10, 2022
97a2c87
fix: exports
neko1101 Nov 10, 2022
c18ad09
chore: update lock
neko1101 Nov 10, 2022
579db93
fix: tests
neko1101 Nov 10, 2022
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
24 changes: 12 additions & 12 deletions __tests__/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ it('should create lead', async () => {
expectTypeOf(response).toMatchTypeOf<type.CreateLeadResponse>()
expect(response.id).toBeDefined()

await cleanupLead({ lead_id: response.id.toString()})
await cleanupLead({ lead_id: response.id!.toString()})
});

it('should delete lead_id', async () => {
Expand All @@ -100,7 +100,7 @@ it('should delete lead_id', async () => {
const lead = await client.createLead(leadParams)

const params: type.DeleteLeadOption = {
lead_id: lead.id
lead_id: lead.id!
}
const response = await client.deleteLead(params)
expectTypeOf(response).toMatchTypeOf<type.DeleteContactResponse>()
Expand All @@ -118,7 +118,7 @@ it('should list leads', async () => {
// @ts-ignore
expect(response.length).toBeGreaterThan(0)

await cleanupLead({lead_id: lead.id.toString()})
await cleanupLead({lead_id: lead.id!.toString()})
});

it('should add contact in lead', async () => {
Expand All @@ -129,13 +129,13 @@ it('should add contact in lead', async () => {

const params: type.CreateContactOption = {
phone: "60199131212",
lead_id: lead.id
lead_id: lead.id!
}
const response = await client.createContact(params)
expectTypeOf(response).toMatchTypeOf<type.CreateContactResponse>()
expect(response.contact_id).toBeDefined()

await cleanupLead({lead_id: lead.id.toString()})
await cleanupLead({lead_id: lead.id!.toString()})
});

it('should get contacts for lead_id', async () => {
Expand All @@ -146,19 +146,19 @@ it('should get contacts for lead_id', async () => {

const contactParams: type.CreateContactOption = {
phone: "60199131212",
lead_id: lead.id
lead_id: lead.id!
}
const contact = await client.createContact(contactParams)

const params: type.GetContactListOption = {
lead_id: lead.id
lead_id: lead.id!
}
const response = await client.getContactList(params)
expectTypeOf(response).toMatchTypeOf<type.GetContactListResponse>()
// @ts-ignore
expect(response.contacts[contact.contact_id]).toBeDefined()

await cleanupLead({lead_id: lead.id.toString()})
await cleanupLead({lead_id: lead.id!.toString()})
});

it('should delete contact in lead_id', async () => {
Expand All @@ -169,19 +169,19 @@ it('should delete contact in lead_id', async () => {

const contactParams: type.CreateContactOption = {
phone: "60199131212",
lead_id: lead.id
lead_id: lead.id!
}
const contact = await client.createContact(contactParams)

const params: type.DeleteContactOption = {
lead_id: lead.id,
lead_id: lead.id!,
contact_id: contact.contact_id!
}
const response = await client.deleteContact(params)
expectTypeOf(response).toMatchTypeOf<type.DeleteContactResponse>()
expect(response.success).toBeTruthy()

await cleanupLead({lead_id: lead.id.toString()})
await cleanupLead({lead_id: lead.id!.toString()})
});

it('should able to delete scheduled message', async () => {
Expand All @@ -194,7 +194,7 @@ it('should able to delete scheduled message', async () => {
const sms = await client.sendSMS(sendSMSParams)

const params: type.DeleteMessageObject = {
message_id: sms.message?.scheduled_message_id
message_id: sms.message!.scheduled_message_id
}
const response = await client.deleteScheduledMessage(params)
expectTypeOf(response).toMatchTypeOf<type.DeleteScheduledMessageResponse>()
Expand Down
6 changes: 4 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {Config} from '@jest/types';

// Sync object
const config: Config.InitialOptions = {
verbose: true,
Expand All @@ -23,5 +24,6 @@ const config: Config.InitialOptions = {
// isolatedModules: true
// }
// }
};
export default config;
}

export default config
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "adasms-sdk",
"homepage": "https://adasms.com/",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"description": "Non-Official ADASMS Client SDK",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*"
"dist/**/*",
"src/**/*"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"rootDir": ".",
"rootDir": "src",
"baseUrl": ".",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"strictNullChecks": false,
Expand All @@ -24,6 +25,6 @@
"dist"
],
"include": [
"./**/*.ts"
"src/**/*.ts"
]
}