Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3971adafd6 | |||
| 1392070b31 | |||
| 85b9e88fc1 | |||
| 92fc894d4b | |||
| b033cfa82b | |||
| 86cba3ce2b | |||
| c752487f9f | |||
| 95f51b0d32 |
@@ -0,0 +1,3 @@
|
||||
for /f "tokens=1 delims=-" %%i in ("%CIRCLE_TAG%") do set "TAG=%%i.%WORKFLOW_NUM%"
|
||||
for /f "tokens=1 delims=/" %%j in ("%CIRCLE_TAG%") do set "SEMVER=%%j"
|
||||
tools\InnoSetup\ISCC.exe tools\powerbi.iss /Sbyparam=$p /DINFO_VERSION=%TAG% /DVERSION=%SEMVER% %*
|
||||
+73
-24
@@ -5,11 +5,34 @@ version: 2.1
|
||||
orbs:
|
||||
win: circleci/windows@5.0
|
||||
|
||||
commands:
|
||||
setup_digicert:
|
||||
description: Set up Digicert Keylocker certificate for code-signing
|
||||
steps:
|
||||
- run:
|
||||
name: "Digicert Signing Manager Setup"
|
||||
command: |
|
||||
cd C:\
|
||||
curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
|
||||
msiexec.exe /i smtools-windows-x64.msi /quiet /qn | Wait-Process
|
||||
- run:
|
||||
name: Setup Digicert ONE Client Cert
|
||||
command: |
|
||||
cd C:\
|
||||
echo $env:SM_CLIENT_CERT_FILE_B64 > certificate.txt
|
||||
certutil -decode certificate.txt certificate.p12
|
||||
- run:
|
||||
name: Sync Certs
|
||||
command: |
|
||||
& $env:SSM\smksp_cert_sync.exe
|
||||
|
||||
jobs:
|
||||
build-connector:
|
||||
executor:
|
||||
name: win/default
|
||||
shell: powershell.exe
|
||||
environment:
|
||||
SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools'
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
@@ -21,53 +44,79 @@ jobs:
|
||||
name: "Build Data Connector"
|
||||
command: "msbuild Speckle.proj /restore /consoleloggerparameters:NoSummary /property:GenerateFullPaths=true"
|
||||
- run:
|
||||
name: Create Innosetup signing cert
|
||||
command: |
|
||||
echo $env:PFX_B64 > "tools\AEC Systems Ltd.txt"
|
||||
certutil -decode "tools\AEC Systems Ltd.txt" "tools\AEC Systems Ltd.pfx"
|
||||
- run:
|
||||
name: Create Signed PFX file
|
||||
command: .\tools\MakePQX\MakePQX.exe pack -mz bin/Speckle.mez -t bin/Speckle.pqx -c "tools\AEC Systems Ltd.pfx" -p $env:PFX_PSW
|
||||
- run:
|
||||
name: Build Installer
|
||||
command: tools\InnoSetup\ISCC.exe tools\powerbi.iss /Sbyparam=$p
|
||||
shell: cmd.exe #does not work in powershell
|
||||
name: Create PQX file
|
||||
command: .\tools\MakePQX\MakePQX.exe pack -mz bin/Speckle.mez -t bin/Speckle.pqx
|
||||
- unless: # Build installers unsigned on non-tagged builds
|
||||
condition: << pipeline.git.tag >>
|
||||
steps:
|
||||
- run:
|
||||
name: Build Installer
|
||||
shell: cmd.exe #does not work in powershell
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
CIRCLE_TAG: 2.0.999-beta/all
|
||||
command: .circleci\build-installer.bat
|
||||
- when: # Setup certificates and build installers signed for tagged builds
|
||||
condition: << pipeline.git.tag >>
|
||||
steps:
|
||||
- setup_digicert
|
||||
- run:
|
||||
name: Build Installer
|
||||
shell: cmd.exe #does not work in powershell
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
command: .circleci\build-installer.bat /DSIGN_INSTALLER /DCODE_SIGNING_CERT_FINGERPRINT=%SM_CODE_SIGNING_CERT_SHA1_HASH%
|
||||
- store_artifacts:
|
||||
path: ./bin
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- bin/*
|
||||
- bin/*.exe
|
||||
deploy-connector:
|
||||
docker:
|
||||
- image: cibuilds/github:0.10
|
||||
- image: cibuilds/github:0.13
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: "Publish Release on GitHub"
|
||||
command: |
|
||||
ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./bin/
|
||||
ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./bin/Speckle.pqx
|
||||
deploy-connector-to-feed:
|
||||
docker:
|
||||
- image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: Install Manager Feed CLI
|
||||
command: dotnet tool install --global Speckle.Manager.Feed
|
||||
- run:
|
||||
name: Upload new version
|
||||
command: |
|
||||
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
|
||||
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
|
||||
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
|
||||
VERSION=$(echo $VER.$WORKFLOW_NUM)
|
||||
/root/.dotnet/tools/Speckle.Manager.Feed deploy -s powerbi -v ${SEMVER} -u https://releases.speckle.dev/installers/powerbi/powerbi-${SEMVER}.exe -o Win -a Any -f ./bin/powerbi-${SEMVER}.exe
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
workflows:
|
||||
build:
|
||||
jobs:
|
||||
- build-connector:
|
||||
context: innosetup
|
||||
context: digicert-keylocker
|
||||
deploy:
|
||||
jobs:
|
||||
- build-connector:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/ # For testing only: /ci\/.*/
|
||||
tags:
|
||||
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/
|
||||
context: innosetup
|
||||
- deploy-connector:
|
||||
filters:
|
||||
filters: &deploy_filter
|
||||
branches:
|
||||
ignore: /.*/ # For testing only: /ci\/.*/
|
||||
tags:
|
||||
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/
|
||||
context: digicert-keylocker
|
||||
- deploy-connector-to-feed:
|
||||
filters: *deploy_filter
|
||||
requires:
|
||||
- build-connector
|
||||
context: github-dev-bot
|
||||
context: do-spaces-speckle-releases
|
||||
|
||||
@@ -54,6 +54,7 @@ Go to the [Releases](https://github.com/specklesystems/speckle-powerbi/releases)
|
||||
```
|
||||
YOUR_USER_FOLDER\Documents\Power BI Desktop\Custom Connectors\
|
||||
```
|
||||
If the folder doesn't exist, create it.
|
||||
|
||||
### Allow custom extensions to run
|
||||
|
||||
|
||||
+16
-24
@@ -11,7 +11,7 @@ Speckle = [
|
||||
// This is the custom authentication strategy for our Connector
|
||||
Authentication = [
|
||||
OAuth = [
|
||||
Label = "Speckle.xyz",
|
||||
Label = "Speckle Account",
|
||||
StartLogin = (clientApplication, dataSourcePath, state, display) =>
|
||||
let
|
||||
server = Text.Combine(
|
||||
@@ -86,10 +86,10 @@ Speckle = [
|
||||
],
|
||||
Key = [
|
||||
KeyLabel = "Personal Access Token",
|
||||
Label = "Private stream"
|
||||
Label = "Private Project"
|
||||
],
|
||||
Implicit = [
|
||||
Label = "Public stream"
|
||||
Label = "Public Project"
|
||||
]
|
||||
],
|
||||
Label = "Speckle"
|
||||
@@ -103,20 +103,16 @@ shared Speckle.GetByUrl.Structured = Value.ReplaceType(
|
||||
url as (
|
||||
Uri.Type meta [
|
||||
Documentation.FieldCaption = "Gets a Speckle Object preserving it's structure",
|
||||
Documentation.FieldDescription = "The url of a stream in a Speckle server. You can copy it directly from your browser.",
|
||||
Documentation.SampleValues = {
|
||||
"https://speckle.xyz/streams/23401adf",
|
||||
"https://speckle.xyz/streams/23401adf/branches/main"
|
||||
}
|
||||
Documentation.FieldDescription = "The url of a model in a Speckle server project. You can copy it directly from your browser.",
|
||||
Documentation.SampleValues = {"https://app.speckle.systems/projects/23401adf/models/1234568"}
|
||||
]
|
||||
)
|
||||
) as record meta [
|
||||
Documentation.Name = "Speckle - Get Structured Object by URL",
|
||||
Documentation.LongDescription = "Returns the Speckle object the URL points to, while also preserving it's structure.
|
||||
Supports all types of stream url:#(lf)
|
||||
- Stream: will get the latest commit on the 'main' branch (i.e. 'https://speckle.xyz/streams/STREAM_ID')#(lf)
|
||||
- Branch: will get the latest commit on the specified branch (i.e. 'https://speckle.xyz/streams/STREAM_ID/branches/BRANCH_NAME')#(lf)
|
||||
- Commit: will get a specific commit from the stream (i.e. 'https://speckle.xyz/streams/STREAM_ID/commits/COMMIT_ID')
|
||||
Supports all types of model url:#(lf)
|
||||
- Model: will get the latest version of the specified model (i.e. 'https://app.speckle.systems/projects/PROJECT_ID/models/MODEL_ID')#(lf)
|
||||
- Version: will get a specific version from the project (i.e. 'https://app.speckle.systems/projects/PROJECT_ID/models/MODEL_ID@VERSION_ID')
|
||||
"
|
||||
]
|
||||
);
|
||||
@@ -132,21 +128,17 @@ shared Speckle.GetByUrl = Value.ReplaceType(
|
||||
type function (
|
||||
url as (
|
||||
Uri.Type meta [
|
||||
Documentation.FieldCaption = "Stream URL",
|
||||
Documentation.FieldDescription = "The url of a stream in a Speckle server. You can copy it directly from your browser.",
|
||||
Documentation.SampleValues = {
|
||||
"https://speckle.xyz/streams/23401adf",
|
||||
"https://speckle.xyz/streams/23401adf/branches/main"
|
||||
}
|
||||
Documentation.FieldCaption = "Model URL",
|
||||
Documentation.FieldDescription = "The url of a model in a Speckle server. You can copy it directly from your browser.",
|
||||
Documentation.SampleValues = {"https://app.speckle.systems/projects/23401adf/models/1234568"}
|
||||
]
|
||||
)
|
||||
) as table meta [
|
||||
Documentation.Name = "Speckle - Get stream by URL",
|
||||
Documentation.LongDescription = "Returns a flat list of all objects contained in a specific Speckle stream/branch/commit/object.
|
||||
Supports all types of stream url:#(lf)
|
||||
- Stream: will get the latest commit on the 'main' branch (i.e. 'https://speckle.xyz/streams/STREAM_ID')#(lf)
|
||||
- Branch: will get the latest commit on the specified branch (i.e. 'https://speckle.xyz/streams/STREAM_ID/branches/BRANCH_NAME')#(lf)
|
||||
- Commit: will get a specific commit from the stream (i.e. 'https://speckle.xyz/streams/STREAM_ID/commits/COMMIT_ID')
|
||||
Documentation.Name = "Speckle - Get Model by URL",
|
||||
Documentation.LongDescription = "Returns a flat list of all objects contained in a Speckle model/version of a specific a project.
|
||||
Supports all types of model url:#(lf)
|
||||
- Model: will get the latest version of the specified model (i.e. 'https://app.speckle.systems/projects/PROJECT_ID/models/MODEL_ID')#(lf)
|
||||
- Version: will get a specific version from the project (i.e. 'https://app.speckle.systems/projects/PROJECT_ID/models/MODEL_ID@VERSION_ID')
|
||||
"
|
||||
]
|
||||
);
|
||||
|
||||
+6
-1
@@ -1,2 +1,7 @@
|
||||
// Use this file to write queries to test your data connector
|
||||
let result = Speckle.GetByUrl("https://app.speckle.systems/projects/e2988234fb/models/60b2300470@b1f31a351a") in result
|
||||
let
|
||||
result = Speckle.GetByUrl(
|
||||
"https://app.speckle.systems/projects/e2988234fb/models/60b2300470@b1f31a351a,60b2300470"
|
||||
)
|
||||
in
|
||||
result
|
||||
|
||||
+86
-81
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
@@ -22,8 +22,10 @@
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing"
|
||||
mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework
|
||||
object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
@@ -59,116 +61,119 @@
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="GetByUrl.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by Stream URL</value>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="GetByUrl.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by Model URL</value>
|
||||
</data>
|
||||
<data name="GetByUrl.Label" xml:space="preserve">
|
||||
<data name="GetByUrl.Label" xml:space="preserve">
|
||||
<value>Speckle</value>
|
||||
</data>
|
||||
<data name="GetByUrl.Title" xml:space="preserve">
|
||||
<value>Speckle - Get stream by URL</value>
|
||||
<data name="GetByUrl.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Model by URL</value>
|
||||
</data>
|
||||
<data name="GetObjFromBranch.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by serer URL, stream ID and branch name</value>
|
||||
<data name="GetObjFromBranch.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by server URL, stream ID and branch name</value>
|
||||
</data>
|
||||
<data name="GetObjFromBranch.Label" xml:space="preserve">
|
||||
<data name="GetObjFromBranch.Label" xml:space="preserve">
|
||||
<value>Get the latest commit from a stream's branch</value>
|
||||
</data>
|
||||
<data name="GetObjFromBranch.Title" xml:space="preserve">
|
||||
<data name="GetObjFromBranch.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Stream branch</value>
|
||||
</data>
|
||||
<data name="GetObjFromCommit.Help" xml:space="preserve">
|
||||
<data name="GetObjFromCommit.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by server URL, stream ID and commit ID</value>
|
||||
</data>
|
||||
<data name="GetObjFromCommit.Label" xml:space="preserve">
|
||||
<data name="GetObjFromCommit.Label" xml:space="preserve">
|
||||
<value>A label</value>
|
||||
</data>
|
||||
<data name="GetObjFromCommit.Title" xml:space="preserve">
|
||||
<data name="GetObjFromCommit.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Stream commit</value>
|
||||
</data>
|
||||
<data name="GetStream.Help" xml:space="preserve">
|
||||
<data name="GetStream.Help" xml:space="preserve">
|
||||
<value>Connect to Speckle by server URL and stream ID</value>
|
||||
</data>
|
||||
<data name="GetStream.Label" xml:space="preserve">
|
||||
<data name="GetStream.Label" xml:space="preserve">
|
||||
<value>Speckle</value>
|
||||
</data>
|
||||
<data name="GetStream.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Stream by URL [Structured]</value>
|
||||
<data name="GetStream.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Model by URL [Structured]</value>
|
||||
</data>
|
||||
<data name="GetObjectAsNavTable.Title" xml:space="preserve">
|
||||
<data name="GetObjectAsNavTable.Title" xml:space="preserve">
|
||||
<value>Speckle - Get Object as NavTable</value>
|
||||
</data>
|
||||
<data name="GetObjectAsNavTable.Label" xml:space="preserve">
|
||||
<data name="GetObjectAsNavTable.Label" xml:space="preserve">
|
||||
<value>Speckle</value>
|
||||
</data>
|
||||
<data name="GetObjectAsNavTable.Help" xml:space="preserve">
|
||||
<data name="GetObjectAsNavTable.Help" xml:space="preserve">
|
||||
<value>Returns a navigation table for a given object</value>
|
||||
</data>
|
||||
<data name="Traverse.Title" xml:space="preserve">
|
||||
<data name="Traverse.Title" xml:space="preserve">
|
||||
<value>Traverse an object and populate refs</value>
|
||||
</data>
|
||||
<data name="Traverse.Label" xml:space="preserve">
|
||||
<data name="Traverse.Label" xml:space="preserve">
|
||||
<value>Traverse</value>
|
||||
</data>
|
||||
<data name="Traverse.Help" xml:space="preserve">
|
||||
<data name="Traverse.Help" xml:space="preserve">
|
||||
<value>Traverse help</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,5 +1,6 @@
|
||||
let
|
||||
Fetch = Extension.LoadFunction("Api.Fetch.pqm"),
|
||||
GetObject = Extension.LoadFunction("Api.GetObject.pqm"),
|
||||
GetAllObjectChildren = Extension.LoadFunction("Api.GetAllObjectChildren.pqm"),
|
||||
GetObjectFromCommit = Extension.LoadFunction("GetObjectFromCommit.pqm"),
|
||||
GetObjectFromBranch = Extension.LoadFunction("GetObjectFromBranch.pqm"),
|
||||
@@ -34,10 +35,9 @@ in
|
||||
GetObjectFromBranch(server, id, stream[branch])
|
||||
else
|
||||
GetObjectFromBranch(server, id, "main"),
|
||||
removeEmpty = Table.RemoveLastN(commitObjectsTable, 1),
|
||||
addStreamUrl = Table.AddColumn(removeEmpty, "Stream URL", each server & "/streams/" & id),
|
||||
addStreamUrl = Table.AddColumn(commitObjectsTable, "Model URL", each server & "/streams/" & id),
|
||||
addParentObjectId = Table.AddColumn(
|
||||
addStreamUrl, "Commit Object ID", each Value.Metadata(commitObjectsTable)[objectId]
|
||||
addStreamUrl, "Version Object ID", each Value.Metadata(commitObjectsTable)[objectId]
|
||||
),
|
||||
addUrlType = Table.AddColumn(addParentObjectId, "URL Type", each stream[urlType]),
|
||||
addObjectIdCol = Table.AddColumn(addUrlType, "Object ID", each try[data][id] otherwise null),
|
||||
@@ -46,9 +46,9 @@ in
|
||||
),
|
||||
final = Table.ReorderColumns(
|
||||
addSpeckleTypeCol, {
|
||||
"Stream URL",
|
||||
"Model URL",
|
||||
"URL Type",
|
||||
"Commit Object ID",
|
||||
"Version Object ID",
|
||||
"Object ID",
|
||||
"speckle_type",
|
||||
"data"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
let
|
||||
Table.GenerateByPage = Extension.LoadFunction("Table.GenerateByPage.pqm"),
|
||||
Speckle.Api.GetObjectChildren = Extension.LoadFunction("Api.GetObjectChildren.pqm"),
|
||||
Speckle.Api.GetObject = Extension.LoadFunction("Api.GetObject.pqm"),
|
||||
Extension.LoadFunction = (fileName as text) =>
|
||||
let
|
||||
binary = Extension.Contents(fileName), asText = Text.FromBinary(binary)
|
||||
@@ -19,17 +20,27 @@ in
|
||||
// After every page, we check the "nextCursor" record on the metadata of the previous request.
|
||||
// Table.GenerateByPage will keep asking for more pages until we return null.
|
||||
(server as text, streamId as text, objectId as text, optional cursor as text) as table =>
|
||||
Table.GenerateByPage(
|
||||
(previous) =>
|
||||
let
|
||||
// if previous is null, then this is our first page of data
|
||||
nextCursor = if (previous = null) then cursor else Value.Metadata(previous)[Cursor]?,
|
||||
// if the cursor is null but the prevous page is not, we've reached the end
|
||||
page =
|
||||
if (previous <> null and nextCursor = null) then
|
||||
null
|
||||
else
|
||||
Speckle.Api.GetObjectChildren(server, streamId, objectId, 1000, nextCursor)
|
||||
in
|
||||
page
|
||||
) meta [server = server, streamId = streamId, objectId = objectId]
|
||||
let
|
||||
parentObject = Speckle.Api.GetObject(server, streamId, objectId),
|
||||
childrenTable = Table.GenerateByPage(
|
||||
(previous) =>
|
||||
let
|
||||
// if previous is null, then this is our first page of data
|
||||
nextCursor = if (previous = null) then cursor else Value.Metadata(previous)[Cursor]?,
|
||||
// if the cursor is null but the prevous page is not, we've reached the end
|
||||
page =
|
||||
if (previous <> null and nextCursor = null) then
|
||||
null
|
||||
else
|
||||
Speckle.Api.GetObjectChildren(server, streamId, objectId, 1000, nextCursor)
|
||||
in
|
||||
page
|
||||
),
|
||||
parentTable = Table.FromRecords({[data = parentObject]}),
|
||||
resultTable =
|
||||
if (Table.ColumnCount(childrenTable) = 0) then
|
||||
parentTable
|
||||
else
|
||||
Table.Combine({parentTable, childrenTable})
|
||||
in
|
||||
resultTable meta [server = server, streamId = streamId, objectId = objectId]
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
),
|
||||
removed = List.Select(removeTotals, each _[data][speckle_type] <> "Speckle.Core.Models.DataChunk")
|
||||
in
|
||||
removed
|
||||
try removed otherwise objects
|
||||
|
||||
@@ -12,40 +12,70 @@ let
|
||||
Message.Format = "Loading '#{0}' failed - '#{1}': '#{2}'",
|
||||
Message.Parameters = {fileName, e[Reason], e[Message]},
|
||||
Detail = [File = fileName, Error = e]
|
||||
]
|
||||
],
|
||||
IsFe2Url = (segments as list) as logical => List.Count(segments) = 4 and segments{2} = "models",
|
||||
GetUrlType = (branchName as nullable text, commitId as nullable text, objectId as nullable text) as text =>
|
||||
if (commitId <> null) then
|
||||
"Commit"
|
||||
else if (objectId <> null) then
|
||||
"Object"
|
||||
else if (branchName <> null) then
|
||||
"Branch"
|
||||
else
|
||||
"Stream",
|
||||
ParseFe1Url = (server as text, segments as list) as record =>
|
||||
let
|
||||
streamId = segments{1},
|
||||
branchName = if (List.Count(segments) = 4 and segments{2} = "branches") then segments{3} else null,
|
||||
commitId = if (List.Count(segments) = 4 and segments{2} = "commits") then segments{3} else null,
|
||||
objectId = if (List.Count(segments) = 4 and segments{2} = "objects") then segments{3} else null,
|
||||
urlType = GetUrlType(branchName, commitId, objectId)
|
||||
in
|
||||
[
|
||||
urlType = urlType,
|
||||
server = server as text,
|
||||
id = streamId as nullable text,
|
||||
branch = branchName as nullable text,
|
||||
commit = commitId as nullable text,
|
||||
object = objectId as nullable text
|
||||
],
|
||||
ParseFe2Url = (server as text, segments as list) as record =>
|
||||
let
|
||||
streamId = segments{1},
|
||||
modelList = segments{3},
|
||||
isMultimodel = Text.Contains(modelList, ","),
|
||||
firstModel = Text.Split(modelList, ","){0},
|
||||
modelAndVersion = Text.Split(firstModel, "@"),
|
||||
modelId = modelAndVersion{0},
|
||||
versionId = if (List.Count(modelAndVersion) > 1) then modelAndVersion{1} else null,
|
||||
model = if (modelId <> null) then GetModel(server, streamId, modelId) else null,
|
||||
urlType = GetUrlType(model[name], versionId, null)
|
||||
in
|
||||
if isMultimodel then
|
||||
error
|
||||
Error.Record(
|
||||
"NotSupported",
|
||||
"Multi-model URLs are not supported.",
|
||||
"Try to select just one single model in the web app and paste that in."
|
||||
)
|
||||
else
|
||||
[
|
||||
urlType = urlType,
|
||||
server = server,
|
||||
id = streamId,
|
||||
branch = model[name],
|
||||
commit = versionId,
|
||||
object = null
|
||||
]
|
||||
in
|
||||
(url as text) as record =>
|
||||
let
|
||||
// Get server and streamId, and branchName / commitId / objectid from the input url
|
||||
server = Text.Combine({Uri.Parts(url)[Scheme], "://", Uri.Parts(url)[Host]}),
|
||||
segments = Text.Split(Text.AfterDelimiter(Uri.Parts(url)[Path], "/", 0), "/"),
|
||||
streamId = segments{1},
|
||||
modelList = if (List.Count(segments) = 4 and segments{2} = "models") then segments{3} else null,
|
||||
firstModel = Text.Split(modelList, ","){0},
|
||||
modelAndVersion = Text.Split(firstModel, "@"),
|
||||
modelId = modelAndVersion{0},
|
||||
versionId = if (List.Count(modelAndVersion) > 1) then modelAndVersion{1} else null,
|
||||
model = if (modelId <> null) then GetModel(server, streamId, modelId) else null,
|
||||
branchName = if (List.Count(segments) = 4 and segments{2} = "branches") then segments{3} else null,
|
||||
commitId = if (List.Count(segments) = 4 and segments{2} = "commits") then segments{3} else null,
|
||||
objectId = if (List.Count(segments) = 4 and segments{2} = "objects") then segments{3} else null,
|
||||
modelOrBranchName = if (model <> null) then model[name] else branchName,
|
||||
commitOrVersion = if (versionId <> null) then versionId else commitId,
|
||||
urlType =
|
||||
if (commitOrVersion <> null) then
|
||||
"Commit"
|
||||
else if (objectId <> null) then
|
||||
"Object"
|
||||
else if (modelOrBranchName <> null) then
|
||||
"Branch"
|
||||
else
|
||||
"Stream"
|
||||
isFe2 = IsFe2Url(segments)
|
||||
in
|
||||
[
|
||||
urlType = urlType,
|
||||
server = server,
|
||||
id = streamId,
|
||||
branch = modelOrBranchName,
|
||||
commit = commitOrVersion,
|
||||
object = objectId
|
||||
]
|
||||
if (isFe2) then
|
||||
ParseFe2Url(server, segments)
|
||||
else
|
||||
ParseFe1Url(server, segments)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifdef SIGN_INSTALLER
|
||||
#ifdef CODE_SIGNING_CERT_FINGERPRINT
|
||||
SignTool=byparam {#SourcePath}SignTool\signtool.exe sign /sha1 {#CODE_SIGNING_CERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA512 /fd SHA512 $f
|
||||
#else
|
||||
#error "CODE_SIGNING_CERT_FINGERPRINT is not defined! Please provide the fingerprint of the certificate to use compile time define (i.e. /DCODE_SIGNING_CERT_FINGERPRINT=XXXXX) when invoking ISCC.exe"
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
[Code]
|
||||
function AddThumbPrintToRegistry(fingerprint: String): Boolean;
|
||||
var
|
||||
CurrentValues: TStringList;
|
||||
RegData: string;
|
||||
begin
|
||||
CurrentValues:= TStringList.Create();
|
||||
if RegQueryMultiStringValue(HKLM, 'Software\Policies\Microsoft\Power BI Desktop', 'TrustedCertificateThumbprints', RegData) then
|
||||
CurrentValues.Text:= RegData;
|
||||
|
||||
if CurrentValues.IndexOf(fingerprint) = -1 then
|
||||
begin
|
||||
// If Thumbprint is not already added
|
||||
CurrentValues.Add(fingerprint);
|
||||
RegData:= CurrentValues.Text;
|
||||
Result := RegWriteMultiStringvalue(HKLM, 'Software\Policies\Microsoft\Power BI Desktop', 'TrustedCertificateThumbprints', RegData);
|
||||
end
|
||||
else
|
||||
Result := True; // Already exists
|
||||
|
||||
CurrentValues.Free;
|
||||
end;
|
||||
|
||||
function DelThumbPrintFromRegistry(fingerprint: String): Boolean;
|
||||
var
|
||||
CurrentValues: TStringList;
|
||||
Index: Integer;
|
||||
RegData: string;
|
||||
begin
|
||||
Result:= True;
|
||||
CurrentValues:= TStringList.Create();
|
||||
|
||||
if RegQueryMultiStringValue(HKLM, 'Software\Policies\Microsoft\Power BI Desktop', 'TrustedCertificateThumbprints', RegData) then
|
||||
begin
|
||||
CurrentValues.Text:= RegData;
|
||||
Index := CurrentValues.IndexOf(fingerprint);
|
||||
// If found, remove it
|
||||
if Index <> -1 then
|
||||
begin
|
||||
CurrentValues.Delete(Index);
|
||||
RegData:= CurrentValues.Text;
|
||||
Result := RegWriteMultiStringvalue(HKLM, 'Software\Policies\Microsoft\Power BI Desktop', 'TrustedCertificateThumbprints', RegData);
|
||||
end else begin
|
||||
MsgBox('Failed to add thumbprint', mbError, MB_OK);
|
||||
end;
|
||||
end;
|
||||
|
||||
CurrentValues.Free;
|
||||
end;
|
||||
|
||||
#ifdef CODE_SIGNING_CERT_FINGERPRINT
|
||||
#define FINGERPRINT=CODE_SIGNING_CERT_FINGERPRINT
|
||||
#else
|
||||
#define FINGERPRINT=AppPublisher
|
||||
#endif
|
||||
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
begin
|
||||
if CurStep = ssInstall then
|
||||
begin
|
||||
// this is the installer
|
||||
if not AddThumbPrintToRegistry('{#FINGERPRINT}') then
|
||||
MsgBox('Failed to add thumbprint', mbError, MB_OK);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
begin
|
||||
if CurUninstallStep = usUninstall then
|
||||
begin
|
||||
// Remove thumbprint on uninstall
|
||||
DelThumbPrintFromRegistry('{#FINGERPRINT}');
|
||||
end;
|
||||
end;
|
||||
|
||||
+19
-16
@@ -1,4 +1,4 @@
|
||||
#include "custom-ui.iss"
|
||||
#include "includes\custom-ui.iss"
|
||||
|
||||
#define AppName "Speckle for PowerBI (Data Connector)"
|
||||
#define Slug "powerbi"
|
||||
@@ -6,36 +6,37 @@
|
||||
#define BasePath "..\"
|
||||
#define Bin BasePath + "bin\"
|
||||
|
||||
#define AppVersion "2.0.0"
|
||||
#define AppInfoVersion "2.0.0.1234"
|
||||
#ifndef Version
|
||||
#define Version "2.0.999"
|
||||
#endif
|
||||
|
||||
#ifndef InfoVersion
|
||||
#define InfoVersion "2.0.999.9999"
|
||||
#endif
|
||||
|
||||
#define AppPublisher "Speckle"
|
||||
#define AppURL "https://speckle.systems"
|
||||
#define UninstallerFolder "{autoappdata}\Speckle\Uninstallers\" + Slug
|
||||
|
||||
#define CustomConnectorFolder "{%USERPROFILE}\Documents\Power BI Desktop\Custom Connectors"
|
||||
#define PFX_PSW GetEnv('PFX_PSW')
|
||||
|
||||
[Setup]
|
||||
AppId={{6759e9e1-8c6b-4974-87c3-bb3c8b8ce619}
|
||||
; Shouldn't need to update these
|
||||
AppName={#AppName}
|
||||
AppVersion={#AppInfoVersion }
|
||||
AppVerName={#AppName} {#AppInfoVersion }
|
||||
AppVersion={#Version }
|
||||
AppVerName={#AppName} {#Version}
|
||||
AppPublisher={#AppPublisher}
|
||||
AppPublisherURL={#AppURL}
|
||||
AppSupportURL={#AppURL}
|
||||
AppUpdatesURL={#AppURL}
|
||||
AppCopyright=Copyright (C) 2020-2022 AEC SYSTEMS LTD
|
||||
AppCopyright=Copyright (C) 2020-2024 AEC SYSTEMS LTD
|
||||
DefaultDirName={#UninstallerFolder}
|
||||
VersionInfoVersion={#AppVersion}
|
||||
ChangesAssociations=yes
|
||||
VersionInfoVersion={#InfoVersion}
|
||||
CloseApplications=false
|
||||
PrivilegesRequired=admin
|
||||
OutputBaseFilename={#Slug}
|
||||
OutputDir={#Bin}
|
||||
; Needed so that the rhino registry key is put in the right location
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
|
||||
OutputBaseFilename={#Slug}-{#Version}
|
||||
; UI
|
||||
WindowShowCaption=no
|
||||
WizardSizePercent=100,100
|
||||
@@ -47,7 +48,8 @@ DisableProgramGroupPage=yes
|
||||
DisableWelcomePage=yes
|
||||
DisableFinishedPage=yes
|
||||
|
||||
;SignTool=byparam tools\SignTool\signtool.exe sign /f $qtools\AEC Systems Ltd.pfx$q /p {#PFX_PSW} /tr http://timestamp.digicert.com /td sha256 /fd sha256 $f
|
||||
|
||||
#include "includes\code-signing.iss"
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
@@ -55,5 +57,6 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
[Files]
|
||||
Source: "{#Bin}Speckle.pqx"; DestDir: "{#CustomConnectorFolder}";
|
||||
|
||||
[Registry]
|
||||
Root: HKLM; Subkey: "Software\Policies\Microsoft\Power BI Desktop"; ValueType: multisz; ValueName: "TrustedCertificateThumbprints"; ValueData: "4797ACC22464ED1CF9AFF4C09C2CCF4CF1873EFB"; Flags: uninsdeletekey
|
||||
; TODO: Including the thumbprint in the registry will enable this running in higher security environments.
|
||||
; Currently blocked because of MakePQX.exe not being ready to work with online CSP's like Digicert Keylocker.
|
||||
; #include "includes\registry-thumbprint-edit.iss"
|
||||
|
||||
Reference in New Issue
Block a user