mirror of
https://github.com/standardnotes/server
synced 2026-01-19 20:04:28 -05:00
Compare commits
1 Commits
@standardn
...
@standardn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1322f99808 |
9
.github/workflows/analytics.yml
vendored
9
.github/workflows/analytics.yml
vendored
@@ -11,18 +11,19 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_utility_workflow:
|
||||
name: Server Utility
|
||||
uses: standardnotes/server/.github/workflows/common-server-utility.yml@main
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: analytics
|
||||
workspace_name: "@standardnotes/analytics"
|
||||
e2e_tag_parameter_name: analytics_image_tag
|
||||
deploy_web: false
|
||||
package_path: packages/analytics
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_utility_workflow
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
@@ -187,12 +187,12 @@ jobs:
|
||||
tags: standardnotes/${{ inputs.service_name }}:${{ github.sha }}
|
||||
|
||||
- name: Run E2E test suite
|
||||
uses: convictional/trigger-workflow-and-wait@master
|
||||
uses: convictional/trigger-workflow-and-wait@v1.6.3
|
||||
with:
|
||||
owner: standardnotes
|
||||
repo: self-hosted
|
||||
repo: e2e
|
||||
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
||||
workflow_file_name: testing-with-updating-client-and-server.yml
|
||||
workflow_file_name: testing-with-stable-client.yml
|
||||
wait_interval: 30
|
||||
client_payload: '{"${{ inputs.e2e_tag_parameter_name }}": "${{ github.sha }}"}'
|
||||
propagate_failure: true
|
||||
|
||||
164
.github/workflows/common-server-utility.yml
vendored
164
.github/workflows/common-server-utility.yml
vendored
@@ -1,164 +0,0 @@
|
||||
name: Reusable Server Utility Workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
service_name:
|
||||
required: true
|
||||
type: string
|
||||
workspace_name:
|
||||
required: true
|
||||
type: string
|
||||
deploy_web:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
deploy_worker:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
package_path:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
DOCKER_USERNAME:
|
||||
required: true
|
||||
DOCKER_PASSWORD:
|
||||
required: true
|
||||
CI_PAT_TOKEN:
|
||||
required: true
|
||||
AWS_ACCESS_KEY_ID:
|
||||
required: true
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
temp_dir: ${{ steps.bundle-dir.outputs.temp_dir }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Create Bundle Dir
|
||||
id: bundle-dir
|
||||
run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache build
|
||||
id: cache-build
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
packages/**/dist
|
||||
${{ steps.bundle-dir.outputs.temp_dir }}
|
||||
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Build
|
||||
run: yarn build ${{ inputs.package_path }}
|
||||
|
||||
- name: Bundle
|
||||
run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }}
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache build
|
||||
id: cache-build
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
packages/**/dist
|
||||
${{ needs.build.outputs.temp_dir }}
|
||||
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Build
|
||||
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||
run: yarn build ${{ inputs.package_path }}
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint:${{ inputs.service_name }}
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache build
|
||||
id: cache-build
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
packages/**/dist
|
||||
${{ needs.build.outputs.temp_dir }}
|
||||
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Build
|
||||
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||
run: yarn build ${{ inputs.package_path }}
|
||||
|
||||
- name: Test
|
||||
run: yarn test ${{ inputs.package_path }}
|
||||
|
||||
publish:
|
||||
needs: [ build, test, lint ]
|
||||
|
||||
name: Publish Docker Image
|
||||
uses: standardnotes/server/.github/workflows/common-docker-image.yml@main
|
||||
with:
|
||||
service_name: ${{ inputs.service_name }}
|
||||
bundle_dir: ${{ needs.build.outputs.temp_dir }}
|
||||
package_path: ${{ inputs.package_path }}
|
||||
workspace_name: ${{ inputs.workspace_name }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-web:
|
||||
if: ${{ inputs.deploy_web }}
|
||||
|
||||
needs: publish
|
||||
|
||||
name: Deploy Web
|
||||
uses: standardnotes/server/.github/workflows/common-deploy.yml@main
|
||||
with:
|
||||
service_name: ${{ inputs.service_name }}
|
||||
docker_image: ${{ inputs.service_name }}:${{ github.sha }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-worker:
|
||||
if: ${{ inputs.deploy_worker }}
|
||||
|
||||
needs: publish
|
||||
|
||||
name: Deploy Worker
|
||||
uses: standardnotes/server/.github/workflows/common-deploy.yml@main
|
||||
with:
|
||||
service_name: ${{ inputs.service_name }}-worker
|
||||
docker_image: ${{ inputs.service_name }}:${{ github.sha }}
|
||||
secrets: inherit
|
||||
9
.github/workflows/event-store.yml
vendored
9
.github/workflows/event-store.yml
vendored
@@ -11,18 +11,19 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_utility_workflow:
|
||||
name: Server Utility
|
||||
uses: standardnotes/server/.github/workflows/common-server-utility.yml@main
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: event-store
|
||||
workspace_name: "@standardnotes/event-store"
|
||||
e2e_tag_parameter_name: event_store_image_tag
|
||||
deploy_web: false
|
||||
package_path: packages/event-store
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_utility_workflow
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
46
.github/workflows/revisions.yml
vendored
46
.github/workflows/revisions.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Revisions Server
|
||||
|
||||
concurrency:
|
||||
group: revisions_server
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*standardnotes/revisions-server*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: revisions
|
||||
workspace_name: "@standardnotes/revisions-server"
|
||||
e2e_tag_parameter_name: revisions_image_tag
|
||||
package_path: packages/revisions
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
9
.github/workflows/scheduler.yml
vendored
9
.github/workflows/scheduler.yml
vendored
@@ -11,18 +11,19 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_utility_workflow:
|
||||
name: Server Utility
|
||||
uses: standardnotes/server/.github/workflows/common-server-utility.yml@main
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: scheduler
|
||||
workspace_name: "@standardnotes/scheduler-server"
|
||||
e2e_tag_parameter_name: scheduler_image_tag
|
||||
deploy_web: false
|
||||
package_path: packages/scheduler
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_utility_workflow
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
9
.github/workflows/websockets.yml
vendored
9
.github/workflows/websockets.yml
vendored
@@ -11,17 +11,18 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_utility_workflow:
|
||||
name: Server Utility
|
||||
uses: standardnotes/server/.github/workflows/common-server-utility.yml@main
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: websockets
|
||||
workspace_name: "@standardnotes/websockets-server"
|
||||
e2e_tag_parameter_name: websockets_image_tag
|
||||
package_path: packages/websockets
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_utility_workflow
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
9
.github/workflows/workspace.yml
vendored
9
.github/workflows/workspace.yml
vendored
@@ -11,17 +11,18 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call_server_utility_workflow:
|
||||
name: Server Utility
|
||||
uses: standardnotes/server/.github/workflows/common-server-utility.yml@main
|
||||
call_server_application_workflow:
|
||||
name: Server Application
|
||||
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
|
||||
with:
|
||||
service_name: workspace
|
||||
workspace_name: "@standardnotes/workspace-server"
|
||||
e2e_tag_parameter_name: workspace_image_tag
|
||||
package_path: packages/workspace
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_utility_workflow
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 120,
|
||||
"semi": false
|
||||
}
|
||||
Binary file not shown.
BIN
.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-be24dd50f5.zip
vendored
Normal file
BIN
.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-be24dd50f5.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@grpc-proto-loader-npm-0.6.13-658ac26dfb-6272a0318b.zip
vendored
Normal file
BIN
.yarn/cache/@grpc-proto-loader-npm-0.6.13-658ac26dfb-6272a0318b.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@sentry-core-npm-7.5.0-984c871a50-99c8e93a6f.zip
vendored
Normal file
BIN
.yarn/cache/@sentry-core-npm-7.5.0-984c871a50-99c8e93a6f.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@sentry-hub-npm-7.5.0-993573a68c-27e240423e.zip
vendored
Normal file
BIN
.yarn/cache/@sentry-hub-npm-7.5.0-993573a68c-27e240423e.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@sentry-node-npm-7.5.0-a14989f161-9b65bc44d2.zip
vendored
Normal file
BIN
.yarn/cache/@sentry-node-npm-7.5.0-a14989f161-9b65bc44d2.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@sentry-types-npm-7.5.0-eea3d326fa-8029b56bae.zip
vendored
Normal file
BIN
.yarn/cache/@sentry-types-npm-7.5.0-eea3d326fa-8029b56bae.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@sentry-utils-npm-7.5.0-e8c66594bc-f5045667ea.zip
vendored
Normal file
BIN
.yarn/cache/@sentry-utils-npm-7.5.0-e8c66594bc-f5045667ea.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@types-ioredis-npm-4.28.10-4bdbe26a79-a7f24a8a13.zip
vendored
Normal file
BIN
.yarn/cache/@types-ioredis-npm-4.28.10-4bdbe26a79-a7f24a8a13.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@types-jsonwebtoken-npm-8.5.9-79c2843a81-3f15a76cd5.zip
vendored
Normal file
BIN
.yarn/cache/@types-jsonwebtoken-npm-8.5.9-79c2843a81-3f15a76cd5.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@types-newrelic-npm-7.0.4-4f0b179b51-b44215b3ab.zip
vendored
Normal file
BIN
.yarn/cache/@types-newrelic-npm-7.0.4-4f0b179b51-b44215b3ab.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/cbor-npm-5.2.0-4f6440587f-d60986b9d0.zip
vendored
BIN
.yarn/cache/cbor-npm-5.2.0-4f6440587f-d60986b9d0.zip
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/long-npm-5.2.1-3a12730171-f81b18ff29.zip
vendored
BIN
.yarn/cache/long-npm-5.2.1-3a12730171-f81b18ff29.zip
vendored
Binary file not shown.
BIN
.yarn/cache/lru-cache-npm-4.1.5-ede304cc43-796f26ad92.zip
vendored
Normal file
BIN
.yarn/cache/lru-cache-npm-4.1.5-ede304cc43-796f26ad92.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/mysql2-npm-2.3.3-fa543fff43-dda663a631.zip
vendored
Normal file
BIN
.yarn/cache/mysql2-npm-2.3.3-fa543fff43-dda663a631.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/named-placeholders-npm-1.1.2-5d4cbc92b0-24477df960.zip
vendored
Normal file
BIN
.yarn/cache/named-placeholders-npm-1.1.2-5d4cbc92b0-24477df960.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/newrelic-npm-9.6.0-f10080c2de-eb378acde1.zip
vendored
Normal file
BIN
.yarn/cache/newrelic-npm-9.6.0-f10080c2de-eb378acde1.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/protobufjs-npm-6.11.3-566fb31188-5a7a343bc1.zip
vendored
Normal file
BIN
.yarn/cache/protobufjs-npm-6.11.3-566fb31188-5a7a343bc1.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/pseudomap-npm-1.0.2-0d0e40fee0-33cfbb99ac.zip
vendored
Normal file
BIN
.yarn/cache/pseudomap-npm-1.0.2-0d0e40fee0-33cfbb99ac.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/yallist-npm-2.1.2-2e38c366a3-f3ace13bed.zip
vendored
Normal file
BIN
.yarn/cache/yallist-npm-2.1.2-2e38c366a3-f3ace13bed.zip
vendored
Normal file
Binary file not shown.
@@ -1,18 +0,0 @@
|
||||
Copyright 2022 Contrast Security, Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,43 +0,0 @@
|
||||
# @contrast/fn-inspect
|
||||
|
||||
[](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml)
|
||||
|
||||
This module exposes some useful information from the underlying v8 engine,
|
||||
including:
|
||||
|
||||
- file and line number given a function reference
|
||||
- code events (i.e. `'LAZY_COMPILE'`)
|
||||
|
||||
## Usage
|
||||
|
||||
Getting details about a function:
|
||||
|
||||
```js
|
||||
const { funcInfo } = require('@contrast/fn-inspect');
|
||||
|
||||
function testFn() {}
|
||||
|
||||
const results = funcInfo(testFn);
|
||||
// => { lineNumber: 2, column: 15, file: 'example.js', method: 'testFn', type: 'Function' }
|
||||
```
|
||||
|
||||
Registering a listener for code events:
|
||||
|
||||
```js
|
||||
const { setCodeEventListener } = require('@contrast/fn-inspect');
|
||||
|
||||
setCodeEventListener((event) => {
|
||||
console.log(event);
|
||||
});
|
||||
```
|
||||
|
||||
## Building locally
|
||||
|
||||
`npm run build` will build the project for your current OS and architecture.
|
||||
|
||||
`npm run download` will pull the most recent build artifacts from GitHub.
|
||||
|
||||
## Publishing
|
||||
|
||||
Simply run `npm version` and `git push && git push --tags`. CI will take care of
|
||||
releasing on taggedcommits.
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
"variables" : {
|
||||
"openssl_fips": "",
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "fninspect",
|
||||
"sources": [
|
||||
"src/addon.cc",
|
||||
"src/code-events.cc",
|
||||
"src/event-queue.cc",
|
||||
"src/func-info.cc"
|
||||
],
|
||||
"include_dirs": [
|
||||
"<!(node -e \"require('nan')\")"
|
||||
],
|
||||
"conditions": [
|
||||
[
|
||||
"OS == 'mac'",
|
||||
{
|
||||
"xcode_settings": {
|
||||
"OTHER_CFLAGS": [
|
||||
"-arch x86_64",
|
||||
"-arch arm64"
|
||||
],
|
||||
"OTHER_LDFLAGS": [
|
||||
"-arch x86_64",
|
||||
"-arch arm64"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
|
||||
declare interface FunctionInfo {
|
||||
file: string;
|
||||
column: number;
|
||||
lineNumber: number;
|
||||
method: string;
|
||||
type: 'AsyncFunction' | 'Function';
|
||||
}
|
||||
|
||||
declare interface CodeEvent {
|
||||
func: string;
|
||||
lineNumber: number;
|
||||
script: string;
|
||||
type:
|
||||
| 'Builtin'
|
||||
| 'Callback'
|
||||
| 'Eval'
|
||||
| 'Function'
|
||||
| 'InterpretedFunction'
|
||||
| 'Handler'
|
||||
| 'BytecodeHandler'
|
||||
| 'LazyCompile'
|
||||
| 'RegExp'
|
||||
| 'Script'
|
||||
| 'Stub'
|
||||
| 'Relocation'
|
||||
}
|
||||
|
||||
declare const fnInspect: {
|
||||
/** Retrieves name, type, column, lineNumber and file from a function reference */
|
||||
funcInfo(fn: Function): FunctionInfo | null;
|
||||
|
||||
/**
|
||||
* Sets the function for processing v8 code events.
|
||||
* Will start listening for code events if not already listening.
|
||||
* starts a timer which polls for an available code event once every `interval` ms.
|
||||
*/
|
||||
setCodeEventListener(cb: (event: CodeEvent) => void, interval?: number): void;
|
||||
|
||||
/** Stop listening for v8 code events */
|
||||
stopListening(): void;
|
||||
};
|
||||
|
||||
export = fnInspect;
|
||||
@@ -1,58 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const binding = require('node-gyp-build')(__dirname);
|
||||
|
||||
let codeEventsInited = false;
|
||||
let codeEventListener = null;
|
||||
let timer = null;
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Retrieves name, type, column, lineNumber and file from a function reference
|
||||
*
|
||||
* @param {Function} fn function reference to obtain info
|
||||
* @return {FunctionInfo | null}
|
||||
*/
|
||||
funcInfo(fn) {
|
||||
const info = binding.funcInfo(fn);
|
||||
if (info === null) return null;
|
||||
|
||||
info.type = fn.constructor.name;
|
||||
return info;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the function for processing v8 code events.
|
||||
* Will start listening for code events if not already listening.
|
||||
* starts a timer which polls for an available code event once every `interval` value.
|
||||
*
|
||||
* @param {Function} cb callback function to call
|
||||
* @param {number} [interval=1] how often to get code events in ms
|
||||
*/
|
||||
setCodeEventListener(cb, interval = 1) {
|
||||
if (codeEventsInited) {
|
||||
codeEventListener = cb;
|
||||
return;
|
||||
}
|
||||
|
||||
binding.initHandler();
|
||||
codeEventsInited = true;
|
||||
codeEventListener = cb;
|
||||
timer = setInterval(() => {
|
||||
const codeEvent = binding.getNextCodeEvent();
|
||||
if (codeEvent) codeEventListener(codeEvent);
|
||||
}, interval);
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop listening for v8 code events
|
||||
*/
|
||||
stopListening() {
|
||||
if (!codeEventsInited) return;
|
||||
|
||||
clearInterval(timer);
|
||||
binding.deinitHandler();
|
||||
codeEventListener = null;
|
||||
codeEventsInited = false;
|
||||
},
|
||||
};
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"name": "@contrast/fn-inspect",
|
||||
"version": "3.3.0",
|
||||
"description": "Retrieve function name and line number from a function reference",
|
||||
"keywords": [
|
||||
"instrumentation"
|
||||
],
|
||||
"author": "Contrast Security",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Contrast-Security-Inc/node-fn-inspect.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Contrast-Security-Inc/node-fn-inspect/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Contrast-Security-Inc/node-fn-inspect#readme",
|
||||
"files": [
|
||||
"prebuilds/",
|
||||
"src/",
|
||||
"binding.gyp",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"install": "node-gyp-build",
|
||||
"prepare": "husky install",
|
||||
"build": "prebuildify -t 12.13.0 -t 14.15.0 -t 16.9.1 -t 18.7.0 --strip",
|
||||
"build:linux": "prebuildify-cross -i centos7-devtoolset7 -i alpine -i linux-arm64 -t 12.13.0 -t 14.15.0 -t 16.9.1 -t 18.7.0 --strip",
|
||||
"build:darwin": "npm run build -- --arch x64+arm64",
|
||||
"build:win32": "npm run build",
|
||||
"clean": "rimraf build/ coverage/ prebuilds/",
|
||||
"download": "node scripts/download-artifacts.js",
|
||||
"test": "c8 --reporter lcov --reporter text mocha .",
|
||||
"test:valgrind": "valgrind --xml=yes --xml-file=./valgrind.xml --trace-children=yes --leak-check=full --show-leak-kinds=all mocha . && node scripts/parse-valgrind.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"nan": "^2.16.0",
|
||||
"node-gyp-build": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@contrast/eslint-config": "^3.1.1",
|
||||
"@ls-lint/ls-lint": "^1.11.2",
|
||||
"@octokit/rest": "^18.12.0",
|
||||
"c8": "^7.11.3",
|
||||
"chai": "^4.3.6",
|
||||
"husky": "^8.0.1",
|
||||
"inquirer": "^8.2.4",
|
||||
"lint-staged": "^13.0.1",
|
||||
"mocha": "^10.0.0",
|
||||
"node-gyp": "^9.0.0",
|
||||
"prebuildify": "^5.0.0",
|
||||
"prebuildify-cross": "^5.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"unzipper": "^0.10.11",
|
||||
"xml-js": "^1.6.11"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user