{"id":23333957,"url":"https://github.com/schultyy/blackmagic","last_synced_at":"2025-04-07T12:13:43.826Z","repository":{"id":6916457,"uuid":"8167063","full_name":"schultyy/blackMagic","owner":"schultyy","description":"Access the Outlook object model with JavaScript","archived":false,"fork":false,"pushed_at":"2013-07-19T14:36:30.000Z","size":588,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T23:35:28.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schultyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-12T20:51:45.000Z","updated_at":"2013-12-12T21:30:27.000Z","dependencies_parsed_at":"2022-09-13T12:01:31.864Z","dependency_job_id":null,"html_url":"https://github.com/schultyy/blackMagic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2FblackMagic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2FblackMagic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2FblackMagic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2FblackMagic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schultyy","download_url":"https://codeload.github.com/schultyy/blackMagic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648975,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T00:33:03.402Z","updated_at":"2025-04-07T12:13:43.799Z","avatar_url":"https://github.com/schultyy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blackMagic\n\n## What?\nProvides basic JavaScript access to the Outlook 2007 Object model. I created this project to have quick access to the Outlook API without writing a full blown C# program. The API may not be that convenient, but it should be usable.\n\n## Remarks\n\nThe thing here is, that you can not just expose the .Net interop classes to JS, this results in exceptions (it is even a headache, if you want to share an interop object between two assemblies). Jurassic also requires all exposed classes to inherit from ObjectInstance ([Except supported types](http://jurassic.codeplex.com/wikipage?title=Supported%20types\u0026referringTitle=Documentation)). So every interop object needs to be converted in some sort of an DTO (data transfer object). This is takes some time but gives you the chance to expose only the parts you really need. If you ever designed a web service, the concept should look familiar to you. \nAt the moment, the most code is C# because it takes some code to bring Outlook to JS, same for file system access.\nThe fs-API looks like the node fs-API, but with the constraint, that only blocking methods are available.\n\n## Modules\nThe module system should look like as it is specified by [Common.js](http://www.commonjs.org/specs/modules/1.0/) , if there is something missing, send a pull request.\nUsing a module in your code is very simple, just ```require``` are module:\n```JavaScript\nvar fs = require(\"fs\");\n```\n### So I want to build a new module\nRight, at first, write your module (for example math.js):\n```JavaScript\nexports.add = function(a,b){ return a + b; };\n```\nIt is important, that all objects and functions, that should be publicly visible, are a property of exports.\nCopy your file to the folder Builtin. When requiring a module, blackMagic looks in this folder for a file with the matching filename.\n# Dependencies\n* [Jurassic JavaScript Compiler](http://jurassic.codeplex.com/)\n* nunit\n* Office Interop Assemblies for Office 2007\n\n# API\n## MailRepository\n### Instantiation\n```JavaScript\nvar repository = new MailRepository();\n```\n### getFolderNames (object root)\nIf root is null, then returns root level folder names.\n### getChildrenFor (string folderName)\nReturns child folders for a certain folder. If the certain folder has no children, an empty array will be returned.\n### getMailsForFolder (object parameters)\nReturns a collection of mails for a certain folder.\nThis accepts an object with either a property 'UniqueId' or 'FolderName'. If you pass in the unique id, the folder tree gets enumerated to find the folder.\nIf you pass in a folder name, you need to specify the complete path to your folder. \n\nExample:\n```JavaScript\nrepository.getMailsForFolder({'FolderName' : 'Personal Folders/Inbox' });\n```\n### updateEmail(Email mail)\nUpdates an email (Currently it updates Subject and BodyText).\n### sendEmail(Email mail)\nSend an email to n recipients.\nExample:\n```JavaScript\n//At the moment only these three properties are supported\nrepository.sendEmail({\n\t\"Subject\" : \"Ohai\",\n\t\"Recipients\" : \"johndoe@example.com\",\n\t\"BodyText\" : \"Woah, this really seems to work\"\n});\n```\n### saveAttachment (string mailUniqueId, AttachmentInstance attachment, string filename)\nSaves an attachment to disk.\n### deleteAttachment (string mailUniqueId, AttachmentInstance attachment)\nDeletes attachment from a specific mail.\n### saveEmail(string mailUniqueId, string filename)\nSaves an email as msg file to disk.\n## File system\n### Remarks\nProvides basic file system access.\n### Usage\n```JavaScript\nvar fs = require(\"fs\");\n```\n### readFileSync (string filename)\n### writeFileSync (string filename, string content)\n### exists (string path)\nTests, if a certain file or path exists.\n### createDirectory (string directoryName)\nCreates a new directory.\n### combine (string[] paths)\nCombines an array of paths to a valid directory or file identifier.\n## Folder\n### Name (string)\n### UniqueId (string)\n### FolderType (string)\n## Email\n### UniqueId (string)\n### Subject (string)\n### Sender (string)\nSender's email address\n### SenderName (string)\nSender's display name\n### Recipients (string[])\nCollection of recipients (email addresses only).\n### ReceivedOn (date)\n### SendOn (date)\n### Attachments (Attachment[])\nCollection of attachments that belong to a certain email.\n## Attachment\n### Displayname (string)\n### Filename (string)\n### Size (int)\n### Index (int)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fblackmagic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschultyy%2Fblackmagic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fblackmagic/lists"}