-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88d5dbb
commit 66186d8
Showing
2 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Knock } from "../src/knock"; | ||
import { ListSchedulesProps } from "../src/resources/workflows/interfaces"; | ||
|
||
// npx ts-node index.ts | ||
async function main() { | ||
try { | ||
// dev "sk_test_9pTKnHlI2IvUszbb4-fK20enCeQcAjMRk2USZMpa6yU" | ||
// local sk_test_XQPmyTEvFKJFO1H4i2sz24gAA3cCEV-kZUMt_6U6p_U | ||
const knock = new Knock( | ||
"sk_test_9pTKnHlI2IvUszbb4-fK20enCeQcAjMRk2USZMpa6yU", | ||
{ | ||
// host: "http://localhost:4001", | ||
host: "https://api.knock-dev.app", | ||
}, | ||
); | ||
|
||
const params: ListSchedulesProps = { | ||
recipients: ["007", { collection: "object_collection", id: "object_id" }], | ||
after: undefined, | ||
before: undefined, | ||
page_size: undefined, | ||
}; | ||
const res = await knock.get("/v1/users/007/schedules", { | ||
...params, | ||
}); | ||
|
||
console.log(res); | ||
// const users = await knock.users.list() | ||
// console.log(users) | ||
|
||
// await knock.users.identify("es", { | ||
// locale: "es-MX" | ||
// }) | ||
|
||
// await knock.objects.setChannelData( | ||
// "$tenants", | ||
// "tenant-123", | ||
// "506ccea0-8350-4549-bf6c-0ef70268bfd3", | ||
// { | ||
// tokens: ["apns-user-push-token"], | ||
// }, | ||
// ); | ||
|
||
// await knock.users.setChannelData("tenant-123", "506ccea0-8350-4549-bf6c-0ef70268bfd3", { | ||
// tokens: ["apns-user-push-token"], | ||
// }) | ||
|
||
// await knock.users.setChannelData("1234", "506ccea0-8350-4549-bf6c-0ef70268bfd3", { | ||
// tokens: ["apns-user-push-token"], | ||
// }) | ||
|
||
// await knock.workflows.trigger("send-windows", { | ||
// recipients: ["[email protected]"] | ||
// }) | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
|
||
main(); |