Compare commits

..

1 Commits

Author SHA1 Message Date
standardci
1322f99808 chore(release): publish new version
- @standardnotes/analytics@2.9.7
 - @standardnotes/api-gateway@1.38.2
 - @standardnotes/auth-server@1.59.8
 - @standardnotes/common@1.44.2
 - @standardnotes/domain-events-infra@1.9.24
 - @standardnotes/domain-events@2.86.1
 - @standardnotes/event-store@1.6.19
 - @standardnotes/files-server@1.8.19
 - @standardnotes/predicates@1.5.5
 - @standardnotes/scheduler-server@1.13.20
 - @standardnotes/security@1.6.2
 - @standardnotes/settings@1.18.1
 - @standardnotes/sncrypto-node@1.12.1
 - @standardnotes/syncing-server@1.13.3
 - @standardnotes/time@1.13.1
 - @standardnotes/websockets-server@1.4.21
 - @standardnotes/workspace-server@1.17.19
2022-11-14 09:08:49 +00:00
819 changed files with 20192 additions and 17640 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 }}"

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

2
.nvmrc
View File

@@ -1 +1 @@
18.12.1
16.15.1

884
.pnp.cjs generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +0,0 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"semi": false
}

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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.

View File

@@ -1,43 +0,0 @@
# @contrast/fn-inspect
[![Test](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml/badge.svg)](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.

View File

@@ -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"
]
}
}
]
]
}
]
}

View File

@@ -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;

View File

@@ -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;
},
};

View File

@@ -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"
}
}

Some files were not shown because too many files have changed in this diff Show More