Daniel15 Github contribution chart
Daniel15 Github Stats
Daniel15 Most Used Languages

Activity

18 Sep 2022

Daniel15

started

Started On 18 Sep 2022 at 08:37:36

Daniel15

started

Started On 16 Sep 2022 at 11:44:00

Daniel15

started

Started On 13 Sep 2022 at 01:21:32

Daniel15

started

Started On 12 Sep 2022 at 01:34:04
Issue Comment

Daniel15

Docs: Link for `@defer` directive (and others) points to intern

In the most recent Glossary page in the docs, the "See the documentation" link for @defer points to the wiki: https://www.internalfb.com/intern/wiki/Relay/Web/incremental-data-delivery-defer-stream/#defer

It'd be helpful to get some more information about how the directive works into the public docs.


There are other links to intern in the docs, though it looks like a few of them are intentional—it may be worth auditing this list to see if they should be changed. If not, I can open a PR updating the docs to at least indicate them as FB-only.

docs % grep -R '/intern/' .
./api-reference/hooks/use-query-loader.md:            * `fetchPolicy`: _*[Optional]*_ Determines if cached data should be used, and when to send a network request based on the cached data that is currently available in the Relay store (for more details, see our [Fetch Policies](https://www.internalfb.com/intern/wiki/Relay/guided-tour-of-relay/reusing-cached-data-for-rendering/#fetch-policies) and [Garbage Collection](https://www.internalfb.com/intern/wiki/Relay/guided-tour-of-relay/reusing-cached-data-for-rendering/#garbage-collection-in-re) guides):
./api-reference/entrypoint-apis/use-entrypoint-loader.md:For more information, see the [Loading EntryPoints](https://www.internalfb.com/intern/wiki/Relay/Guides/entry-points/#loading-entrypoints) guide.
./guided-tour/introduction.md:* [Javascript](https://our.internmc.facebook.com/intern/wiki/JavaScript/)
./guided-tour/introduction.md:* [React](https://our.internmc.facebook.com/intern/wiki/ReactGuide/)
./guided-tour/introduction.md:* [GraphQL](https://our.internmc.facebook.com/intern/wiki/GraphQL/) and our internal [GraphQL Server](https://our.internmc.facebook.com/intern/wiki/Graphql-for-hack-developers/)
./guided-tour/updating-data/graphql-mutations.md:* Check out the [Hack documentation on writing mutations](https://www.internalfb.com/intern/wiki/Graphql-for-hack-developers/mutation-root-fields/) for information on how to add a mutation field to your back-end code.
./guided-tour/updating-data/graphql-subscriptions.md:[GraphQL Subscriptions](https://our.internmc.facebook.com/intern/wiki/GraphQL_Subscriptions/) (GQLS) are a mechanism which allow clients to subscribe to changes in a piece of data from the server, and get notified whenever that data changes.
./guided-tour/updating-data/graphql-subscriptions.md:At Facebook, the Network Layer has already been configured to handle GraphQL Subscriptions. For more details on writing subscriptions at Facebook, check out this [guide](../../../guides/writing-subscriptions/). For a guide on setting up subscriptions on the server side, check out this [wiki](https://our.internmc.facebook.com/intern/wiki/GraphQL_Subscriptions/creating-a-new-subscription/).
./guides/testing-relay-with-preloaded-queries.md:* [D23078476](https://internalfb.com/intern/diff/D23078476)
./glossary/glossary.md:A field implementing the connection spec. See <a href="https://www.internalfb.com/intern/wiki/Graphql-connections-for-hack-developers/Connection-spec/">here</a> for more details on the spec, and the section of the guided tour on <a href="../guided-tour/list-data/pagination/">rendering list data and pagination</a>.
./glossary/glossary.md:See the [documentation](https://www.internalfb.com/intern/wiki/Relay/Web/incremental-data-delivery-defer-stream/#defer).
./glossary/glossary.md:See the [documentation](https://www.internalfb.com/intern/wiki/Relay/Debugging_Guides/Relay_DevTools_Guide_For_Users/).
./glossary/glossary.md:See more information in the [guided tour](https://www.internalfb.com/intern/wiki/Relay/guided-tour-of-relay/reusing-cached-data-for-rendering/#garbage-collection-in-re).
./glossary/glossary.md:See the [section in the guide](https://www.internalfb.com/intern/wiki/Relay/guided-tour-of-relay/updating-data/#invalidating-data-during).
./glossary/glossary.md:See the [guide on mutations](../guided-tour/updating-data/graphql-mutations), and [this article](https://www.internalfb.com/intern/wiki/Graphql-for-hack-developers/mutation-root-fields/) on defining mutations in your hack code.
./glossary/glossary.md:Projects are defined in a single [config](#config) file, found [here](https://www.internalfb.com/intern/diffusion/WWW/browse/master/scripts/relay/compiler-rs/config.www.json) and [here](https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/relay/compiler-rs/config.xplat.json).
./glossary/glossary.md:For more info, look [here](https://www.internalfb.com/intern/wiki/GraphQL/Build_Infra/Schema_Sync/) and [here](https://www.internalfb.com/intern/wiki/Relay-team/GraphQL_Schema_Sync/). 

Forked On 06 Sep 2022 at 09:52:48

Daniel15

Some of them are intentional - The documentation has some internal-only content, usually wrapped in <FbInternalOnly>. Do any of these links still appear in the public-facing documentation?

Commented On 06 Sep 2022 at 09:52:48
Issue Comment

Daniel15

https://www.internalfb.com/intern/bug-bounty/get-canary-token

Describe the bug

(Write your answer here.)

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)

Steps to reproduce

(Write your steps here:)

Expected behavior

(Write what you thought would happen.)

Actual behavior

(Write what happened. Please add screenshots!)

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Forked On 06 Sep 2022 at 09:49:56

Daniel15

Doesn't seem relevant to create-react-app.

Commented On 06 Sep 2022 at 09:49:56
Issue Comment

Daniel15

[Feature request]: `no_occupancy_since` feature for Philips Hue motion sensors

Is your feature request related to a problem? Please describe

If I understand it right, the no_occupancy_since feature was introduced a while ago here: https://github.com/Koenkk/zigbee2mqtt/issues/1195 , which reads as if this was supposed to be a feature for all motion sensors.

I can't confirm it working and I also don't see it being mentioned in the documentation for the Philips Hue motion sensor https://www.zigbee2mqtt.io/devices/9290012607.html

I suppose when this feature was added the sensor was not yet supported or simply overlooked.

Describe the solution you'd like

Will it be possible to extend this very useful feature to Philips motion sensors? Maybe in some more generic way it can be done to really all present (and future) supported motion sensors, since this is purely a software feature, if I understand it right?

Forked On 03 Sep 2022 at 11:51:54

Daniel15

can you share me the node red automation. I'm quite new and don't know how to trigger no_occupancy_since payload

@dangnguyen0906 Sure!

I use it to dim one of my wall-mounted tablets when nobody is near it.

I have a device in Zigbee2MQTT called "Hallway Outside Office Motion", and its no_occupancy_since is set to [60, 240], meaning it'll send one no_occupancy_since after 60 seconds and another after 240 seconds (4 minutes).

Here's what the Node-RED flow looks like: image

  • The first node is an "MQTT In" node, subscribed to a single topic zigbee2mqtt/Hallway Outside Office Motion.
  • "No occupancy for 4 mins?" is a switch node that checks if msg.payload.no_occupancy_since == 240
  • "Occupancy?" is a switch node that checks if msg.payload.occupancy is true.
  • "Idle" and "Not idle" just turn on/off an input boolean in Home Assistant, that is used in other automations.

Here's the JSON:

[
    {
        "id": "d013ab33ba54a861",
        "type": "mqtt in",
        "z": "2862b0b5fa361917",
        "name": "Motion sensor",
        "topic": "zigbee2mqtt/Hallway Outside Office Motion",
        "qos": "2",
        "datatype": "json",
        "broker": "e811c8eb637d26a5",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 90,
        "y": 120,
        "wires": [
            [
                "8b06d40982d5e33c",
                "982e511c8ed0245b"
            ]
        ]
    },
    {
        "id": "8b06d40982d5e33c",
        "type": "switch",
        "z": "2862b0b5fa361917",
        "name": "No occupancy for 4 mins?",
        "property": "payload.no_occupancy_since",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "240",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 290,
        "y": 120,
        "wires": [
            [
                "ee1704a8f1d32203"
            ]
        ]
    },
    {
        "id": "ee1704a8f1d32203",
        "type": "api-call-service",
        "z": "2862b0b5fa361917",
        "name": "Idle",
        "server": "b6f128b45d1d76f7",
        "version": 3,
        "debugenabled": false,
        "service_domain": "input_boolean",
        "service": "turn_on",
        "entityId": "input_boolean.dashboard_idle",
        "data": "",
        "dataType": "jsonata",
        "mergecontext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 470,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "6684fad0637f6d58",
        "type": "api-call-service",
        "z": "2862b0b5fa361917",
        "name": "Not idle",
        "server": "b6f128b45d1d76f7",
        "version": 3,
        "debugenabled": false,
        "service_domain": "input_boolean",
        "service": "turn_off",
        "entityId": "input_boolean.dashboard_idle",
        "data": "",
        "dataType": "jsonata",
        "mergecontext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 480,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "982e511c8ed0245b",
        "type": "switch",
        "z": "2862b0b5fa361917",
        "name": "Occupancy?",
        "property": "payload.occupancy",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 250,
        "y": 160,
        "wires": [
            [
                "6684fad0637f6d58"
            ]
        ]
    },
    {
        "id": "e811c8eb637d26a5",
        "type": "mqtt-broker",
        "name": "localhost",
        "broker": "192.168.0.36",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    },
    {
        "id": "b6f128b45d1d76f7",
        "type": "server",
        "name": "Home Assistant",
        "version": 2,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30"
    }
] 

Commented On 03 Sep 2022 at 11:51:54

Daniel15

started

Started On 02 Sep 2022 at 09:26:03

Daniel15

started

Started On 02 Sep 2022 at 09:25:56

Daniel15

started

Started On 02 Sep 2022 at 09:25:48

Daniel15

Use intermediate file for dual signing with osslsigncode

Pushed On 11 Aug 2022 at 09:01:47

Daniel15

Use intermediate file for dual signing with osslsigncode

Created On 11 Aug 2022 at 09:01:46
Issue Comment

Daniel15

Use intermediate file for dual signing with osslsigncode

SecureSign is not compatible with more recent versions of osslsigncode (2.1 and above), which have been fixed to no longer permit in-place signing. In-place signing cannot be guaranteed to work due to the OpenSSL API, as per https://github.com/mtrojnar/osslsigncode/pull/68 .

This pull request changes the SignUsingOpenSsl function in AuthenticodeSigner.cs to use an intermediate file as the output of the first sign stage; the intermediate file is then used as the input of the second sign stage.

This has been tested with osslsigncode 2.3.

Forked On 11 Aug 2022 at 09:01:39

Daniel15

Thanks for the pull request! Looks good to me.

Commented On 11 Aug 2022 at 09:01:39
Issue Comment

Daniel15

Bump micromatch from 3.1.10 to 4.0.4

Refs https://github.com/facebook/jscodeshift/issues/490

Forked On 10 Aug 2022 at 08:23:37

Daniel15

I can do this today.

Commented On 10 Aug 2022 at 08:23:37
Issue Comment

Daniel15

Transformation error (Unexpected symbol <b> at ...

Hello,

I am using JScodeshift to make some changes in json with my eycloak-capacitor project.

 // Replace dependancies
    return mainRoot
        .find(
            j.Property,
            {
                key: {
                    name: "dependancies"
                }
            }
        )
        .find(j.ObjectExpression)
        .replaceWith((nodePath) => {
            const { node } = nodePath;
            // replace properties
            node.properties = newProperties;
            return node;
        })
        .toSource({ quote: "double" }); 

However, it doesn't seem to work when toSource is invoked :

Transformation error (Unexpected symbol <b> at 37:28 35 |    }, 36 |    "dependencies":{ 37 |       "base64-js":"^1.5.1",base64-js"^1.5.1"
                      ^ 38 |       "js-sha256":"^0.9.0"js-sha256"^4.2.0" 39 |    },)
SyntaxError: Unexpected symbol <b> at 37:28
35 |    },
36 |    "dependencies":{
37 |       "base64-js":"^1.5.1",base64-js"^1.5.1"
                                ^
38 |       "js-sha256":"^0.9.0"js-sha256"^4.2.0"
39 |    }, 

If node.properties = newProperties; is put on comments, then I got no error but not the behavior I am expecting.

image

Steps to reproduce :

https://github.com/jy95/keycloak-capacitor/tree/jscodeshift-packageJson
git checkout jscodeshift-packageJson
npm install
npx jscodeshift -t update-packageJson.ts __testfixtures__/update-packageJson.input.json -originalKeycloakPath __testfixtures__/update-packageJson.input2.json  -d -p 

Kind regards,

Forked On 09 Aug 2022 at 10:32:27

Daniel15

I've never tried JSCodeshift for JSON files... Which parser are you using? Please link to an ASTExplorer.net repro.

For JSON, wouldn't it be easier to just use JSON.parse and manipulate it that way?

Commented On 09 Aug 2022 at 10:32:27

Daniel15

Created WallPanel website

I made a website for the project. The content was mostly copied from the old wiki. It's just a basic Docusaurus site using the default theme (other than changing the accent colour) but it's probably good enough to begin with.

Preview: https://wallpanel.netlify.app/. If you like it, I can add you to the Netlify account and we can point the domain to the new site 😃

Screenshots: image The blue colour is based off the colour in the logo, but around 20% darker.

image The pages are kinda unorganized other than creating a group specifically for the MQTT pages as there's a few of them.

Fixes #3

Forked On 08 Aug 2022 at 01:22:18

Daniel15

@TheTimeWalker Thanks for merging! Can you please change the DNS servers for wallpanel.xyz to these:

dns1.p05.nsone.net
dns2.p05.nsone.net
dns3.p05.nsone.net
dns4.p05.nsone.net 

These are Netlify's DNS servers. That should make the site work at the domain.

Commented On 08 Aug 2022 at 01:22:18

Daniel15

started

Started On 02 Aug 2022 at 01:04:58

Daniel15

fix: async transform test support

fix #516

Forked On 27 Jul 2022 at 05:19:34

Daniel15

Too bad we can't use async here, because then this could be a bit cleaner: ``` let output = applyTransform(.......); if (isPromise(output)) { output = await output; } expect(output).toMatchSnapshot(); ```
On 27 Jul 2022 at 05:19:34

Daniel15

fix: async transform test support

fix #516

Merged On 27 Jul 2022 at 05:19:34

Daniel15

Commented On 27 Jul 2022 at 05:19:34

Daniel15

fix: async transform test support

fix #516

Forked On 27 Jul 2022 at 05:18:34

Daniel15

Nit: remove empty line
On 27 Jul 2022 at 05:18:34

Daniel15

fix: async transform test support

fix #516

Merged On 27 Jul 2022 at 05:18:35

Daniel15

Commented On 27 Jul 2022 at 05:18:35

Daniel15

fix: async transform test support

fix #516

Forked On 27 Jul 2022 at 05:15:20

Daniel15

Do we really need to pull in a third-party library here?
On 27 Jul 2022 at 05:15:20

Daniel15

fix: async transform test support

fix #516

Merged On 27 Jul 2022 at 05:15:20

Daniel15

Commented On 27 Jul 2022 at 05:15:20

Daniel15

fix: async transform test support

fix #516

Merged On 27 Jul 2022 at 05:14:56

Daniel15

Commented On 27 Jul 2022 at 05:14:56

Daniel15

fix: async transform test support

fix #516

Forked On 27 Jul 2022 at 05:14:55

Daniel15

Make this `async` rather than returning a resolved promise? I think that'll more accurately reflect how people use it.
On 27 Jul 2022 at 05:14:55
Issue Comment

Daniel15

Introduction of an internal function %loadJSON to load JSON data

This new internal function %loadJSON allows loading a JSON data structure from a local file or external HTTP(s) URL. The implementation uses SFile and SURL to manage the security context and configured opt-in folders/domains.

loadJSON supports up to three parameters. A mandatory data-source path (relative file, absolute file-path, http, and https URL), a second default parameter to define a fallback JSON (if the data source has no content), and a third default parameter to choose a charset encoding (default is UTF-8).

A test is included (but only for local files). Short introduction in the JavaDoc comment of LoadJson.java. Also, the test file gives an impression of how to use it.

Example to access a Spring cloud native service (health actuator endpoint):

@startuml

' This example works only with the latest plantuml snapshot an implemented
' %loadJSON function

' Default JSON, if we don't get a content from the data source
!$DEF={"status": "not connected"}

' Load from Spring boot service with actuator 'health' endpoint
!$TEST=%loadJSON("http://localhost:7778/management/health", $DEF)

' Load from local file (relative located in plantuml.include.path list)
!$DEMO=%loadJSON("demo.json")

title Load JSON example with $DEMO.status

' Simple usage
[Service] -> ($TEST.status): is

' Embedded rendering of JSON structure
 rectangle Inner #tan as "
    {{json
    $TEST
    }}
    Health of management service at %date()
    "

@enduml 

JSON load example

Limitations: Authentication is currently not supported. Maybe this should be applied to SURL but it's out of scope for this pull request.

Forked On 26 Jul 2022 at 01:19:51

Daniel15

Shouldn't it be called load_json? It's the only camelcase function - all the others use underscores.

Commented On 26 Jul 2022 at 01:19:51
Issue Comment

Daniel15

bug?: Using ts parser does not replace correctly

I'm using Jscodeshift to replace the following code in astexplorer testing, but I get different results using babel/ts

export const systemCoreApi = wrapApiClient<ISystemApi>({  namespace: 'system' }) 

use babel parser

export const parser = "babel";

// Press ctrl+space for code completion
export default function transformer(file, api) {
  const j = api.jscodeshift;
  const root = j(file.source);

  root
    // .find(j.TSTypeReference)
    .find(j.Identifier, { name: "ISystemApi" })
    .replaceWith((path) => {
      path.node.name = "ISystemCoreApi";
      return path.node;
    });

  return root.toSource();
} 

output

export const systemCoreApi = wrapApiClient<ISystemCoreApi>({  namespace: 'system' }) 

use ts parser

// jscodeshift can take a parser, like "babel", "babylon", "flow", "ts", or "tsx"
// Read more: https://github.com/facebook/jscodeshift#parser
export const parser = "ts";

// Press ctrl+space for code completion
export default function transformer(file, api) {
  const j = api.jscodeshift;
  const root = j(file.source);

  root
    // .find(j.TSTypeReference)
    .find(j.Identifier, { name: "ISystemApi" })
    .replaceWith((path) => {
      path.node.name = "ISystemCoreApi";
      return path.node;
    });

  return root.toSource();
} 

output

export const systemCoreApi = wrapApiClient<ISystemApi>({  namespace: 'system' }) 

Lastly, I'm wondering how to use the @typescript-eslint/parser parser, it seems to work best for parsing ts in ast explorer (the result of ts parsing is very different from other parsers and jscodeshift's api)

image image

Forked On 25 Jul 2022 at 11:58:21

Daniel15

Hmm, if I remove the export const parser = 'ts' and select TypeScript from the dropdown list on ASTExplorer, it works fine? https://astexplorer.net/#/gist/a87887cd564a07395d7f2b1a3f336d2a/2d968bb30b8ca3fdda9b8a31645f1d7e69ca8248

Commented On 25 Jul 2022 at 11:58:21

Daniel15

feat: Use fast-glob actually authentic glob road diameter match

ref: https://github.com/facebook/jscodeshift/issues/512

Sorry, I didn't find the Runner.test.js unit test, so the unit test was not added.

Forked On 25 Jul 2022 at 11:48:54

Daniel15

Instead of creating a new Promise and calling `resolve` in `then`, can you return the fast-glob promise directly? For example: ``` paths.map( (file) => if (file.includes('*')) { return fg([file]) .then((list) => list.filter( (name) => filter(name) && !ignores.shouldIgnore(name) ) ); } return new Promise((resolve) => { // ..... the old code here } ); ```
On 25 Jul 2022 at 11:48:54