{"id":38268649,"url":"https://github.com/dronedeploy/function-wrapper","last_synced_at":"2026-01-17T01:48:22.602Z","repository":{"id":42127103,"uuid":"131621681","full_name":"dronedeploy/function-wrapper","owner":"dronedeploy","description":"Javascript module to interact with dronedeploy api from within a dronedeploy function.","archived":false,"fork":false,"pushed_at":"2026-01-13T16:43:25.000Z","size":634,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":55,"default_branch":"master","last_synced_at":"2026-01-13T18:42:54.908Z","etag":null,"topics":["owner-magic-ai","tier3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dronedeploy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-30T16:50:20.000Z","updated_at":"2026-01-13T16:43:28.000Z","dependencies_parsed_at":"2024-06-25T16:18:07.009Z","dependency_job_id":"493ac2d5-5931-427c-8d22-df977ed013e2","html_url":"https://github.com/dronedeploy/function-wrapper","commit_stats":{"total_commits":87,"total_committers":17,"mean_commits":5.117647058823529,"dds":0.7471264367816092,"last_synced_commit":"334d284c9fce00469b265c10a1a9613c89b7a77f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dronedeploy/function-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dronedeploy%2Ffunction-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dronedeploy%2Ffunction-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dronedeploy%2Ffunction-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dronedeploy%2Ffunction-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dronedeploy","download_url":"https://codeload.github.com/dronedeploy/function-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dronedeploy%2Ffunction-wrapper/sbom","scorecard":{"id":356675,"data":{"date":"2025-08-11","repo":{"name":"github.com/dronedeploy/function-wrapper","commit":"74ab46138cc21221135dcf4755dda6e4dacc0987"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T09:46:02.194Z","repository_id":42127103,"created_at":"2025-08-18T09:46:02.194Z","updated_at":"2025-08-18T09:46:02.194Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["owner-magic-ai","tier3"],"created_at":"2026-01-17T01:48:22.509Z","updated_at":"2026-01-17T01:48:22.594Z","avatar_url":"https://github.com/dronedeploy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Drondeploy Functions API\n========================\n\nInstallation\n============\n\nInstall via\n`npm install --save @dronedeploy/function-wrapper`\n\n\nHow to use this repo in your DroneDeploy function\n==========\n\nIn your index.js\n\nImport the module like so\n\n```javascript\nconst bootstrap = require('@dronedeploy/function-wrapper');\n```\n\nor with Typescript:\n\n```typescript\nimport bootstrap from \"@dronedeploy/function-wrapper\";\n```\n\nThe bootstrap method handles\n- Authentication\n- Default HTTP responses for auth failure, and OPTIONS routes\n- Setting up CORS Headers\n\nThe ctx object will have all the api methods available\nand references to the jwt token in both raw and decrypted form.\n\nThe recommended usage is to import a file named handler.js, where most of the developers code lives. handler.js should expose one public method\n\n```javascript\n// handler.js\nmodule.exports = (req, res, ctx) =\u003e {\n   \n}\n```\n\n```javascript\n// index.js\nexports.dronedeploy = bootstrap((ctx) =\u003e (req, res) =\u003e handler(req, res, ctx));\n```\n\nTemporarily for testing purposes you can override the `ctx.originalToken`, if you set `MOCK_TOKEN=true` and `AUTH_REQUIRED=false` in the `.env` file.\n\nApi Methods\n================\n\ntable(tableId)\n\nMethods on the table object\n\n- addRow(externalKey, data)\n- editRow(externalKey, data)\n- upsertRow(externalKey, data) // subject to change\n\nExample Response for add, edit, upsert\n\n```javascript\n{ ok: true,\n  data:\n   { id: 'TableData:5ae711f72852b900016b0895',\n     application: { id: 'Application:lonvecnbfyvovfqsvbxz' },\n     data: { name: 'Michael Hernandez' },\n     externalKey: 'mhernandez+test@dronedeploy.com-user-information',\n     table: { id: 'Table:5ada2d8f27b7b90001b9c40a' }\n   }\n }\n```\n- getRow(externalKey)\n\nExample Response for get\n\n```javascript\n{ ok: true, data: { name: 'Michael Hernandez' } }\n```\n- deleteRows(externalKeys)\n\nExample Response for delete\n\n```javascript\n{ ok: true, data: { count: 1 } }\n```\n\nExample handler showing the aformentioned methods in use, also see file `examples/basic.js`\n\n```javascript\nfunction handler(req, res, ctx) {\n  // this is for mocking token.\n  ctx.originalToken = process.argv[2] // or switch this out for yours.;\n\n  // Get the users tables\n  let users = ctx\n    .datastore\n    .table('Table:5ada2d8f27b7b90001b9c40a');\n\n  users\n    // .addRow('mhernandez+test@dronedeploy.com', {name: 'Michaxel Hernandez'})\n    // .editRow('mhernandez+test@dronedeploy.com', {name: 'Michaxel Hernandez'})\n    .upsertRow('mhernandez+test@dronedeploy.com', {name: 'Michaxel Hernandez'})\n    .then(result =\u003e {\n      console.log(util.inspect(result, {depth: 20, colors: true}));\n    })\n    .then(() =\u003e {\n      users\n        .getRowByExternalId('mhernandez+test@dronedeploy.com')\n        .then((result) =\u003e {\n          console.log(util.inspect(result, {depth: 20, colors: true}));\n        })\n\n    })\n    .catch(e =\u003e {\n      console.log(e);\n    });\n}\n```\n\nOr TypeScript (see `examples-typescript/basic-typescript.ts`:\n\n```typescript\nasync function handler(req: Request, res: Response, ctx: Context) {\n  // this is for mocking token.\n  ctx.originalToken = process.argv[2];\n  return ctx\n    .as(ownerJWT, true)\n    .datastore\n    .ensure('zqyjaheaxvszfgrtdiep', 'new_table_1', 'mydescription',\n      [{\n        input: {\n          columnType: \"TEXT\",\n          name: \"name\",\n          textLength: 255,\n          description: \"Users name\",\n        }\n      }])\n    .then((tableId: string) =\u003e findTableByName(ctx, 'new_table_1', tableId))\n    .then((tableId: string) =\u003e ctx.datastore.table(tableId))\n    .then((users: Table) =\u003e {\n      users\n        .upsertRow('mhernandez+test@dronedeploy.com', {name: 'Michaxel Hernandez'})\n        .then((result: DatastoreResponse) =\u003e {\n          console.log(inspect(result, {depth: 20, colors: true}));\n        })\n        .then(() =\u003e {\n          users\n            .getRowByExternalId('mhernandez+test@dronedeploy.com')\n            .then((result) =\u003e {\n              console.log(inspect(result, {depth: 20, colors: true}));\n            })\n\n        })\n        .catch(e =\u003e {\n          console.log(e);\n        });\n    }).catch(console.error);\n}\n\nexport default async function func(req: Request, res: Response) {\n  return bootstrap(config, req, res, (err: Error, ctx: Context) =\u003e {\n      // Common headers should have been set automatically.\n      // Common requests like OPTIONS should have been handled automatically.\n      if (err) {\n        console.error(err, err.stack);\n        console.warn('An error occurred during the bootstrapping process. A default response has been sent and code paths have been stopped.');\n        return;\n      }\n\n      return handler(req, res, ctx);\n  });\n}\n```\n\nConfiguration\n================\nConfiguration in `.env` file:\n- `AUTH_REQUIRED=\u003cboolean_string\u003e`, set to false for testing or if your function does not use dd's api's\n- `MOCK_TOKEN=\u003cboolean_string\u003e`, // set to true to allow token\n- `CORS_HEADERS=\u003ccomma_separated_headers\u003e` // add custom headers that should be allowed past cors here\n- `IGNORE_AUTH_ROUTES=\u003ccomma_separated_routes\u003e` // add routes to ignore while checking auth\n\nExample\n```\nAUTH_REQUIRED=false\nMOCK_TOKEN=true\nCORS_HEADERS=x-custom-token,x-some-other-allowed-header\nIGNORE_AUTH_ROUTES=/route/1,/route/2\n```\n\nThese env variables can be also set in the code:\n```javascript\nprocess.env.AUTH_REQUIRED = false\nprocess.env.MOCK_TOCKEN = true\nprocess.env.CORS_HEADERS = ['x-custom-token', 'x-some-other-allowed-header']\nprocess.env.AUTH_REQUIRED = ['/route/1', '/route/2']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdronedeploy%2Ffunction-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdronedeploy%2Ffunction-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdronedeploy%2Ffunction-wrapper/lists"}