Compare commits

..

49 Commits

Author SHA1 Message Date
Iain Sproat e26e1077e0 Merge remote-tracking branch 'template/main' into github-template-update 2022-08-12 17:54:32 +01:00
Iain Sproat aa739c30c6 fix(pull request template): pR template should be the default and not an option
PR template was in a directory which allows selection using queries.  The PR template should be
provided by default so should be renamed and placed in the .github directory.
2022-08-12 17:34:08 +01:00
Iain Sproat 0a321c66fe Remove redundant issue template 2022-08-09 09:37:28 +01:00
Iain Sproat c112f46f01 Merge remote-tracking branch 'template/main' into github-template-update 2022-08-09 09:34:41 +01:00
Iain Sproat a4f764e178 Merge remote-tracking branch 'template/main' into github-template-update 2022-08-09 09:33:55 +01:00
Iain Sproat 59f5ee5452 chore(pr_template): adds a reference section to the PR template
The SpecklePY PR template had a reference section, and it made sense to include it for all
repositories.
2022-08-09 09:32:49 +01:00
Iain Sproat f8b057b990 Refer to the code of conduct in the contributing section of the README 2022-08-08 15:11:09 +01:00
Iain Sproat e2ba8b144a Add a SECURITY.md file 2022-08-08 10:00:36 +01:00
Iain Sproat 8d320abe00 style: tidy newlines and other small formatting 2022-08-08 09:41:18 +01:00
Iain Sproat b77e346736 Merge pull request #3 from specklesystems/revise-issue-templates
Feature: separates issue template into bugs and feature requests
2022-07-27 16:02:55 +01:00
Iain Sproat 0d1c2735d8 checklist is clearer 2022-07-21 17:14:16 +01:00
Iain Sproat 8f3a683851 Retain some sections from previous issue template 2022-07-21 17:08:34 +01:00
Iain Sproat aa8c7b6f42 Add link to contribution guidelines 2022-07-21 17:03:08 +01:00
Iain Sproat 68036ee130 Feature: separates issue template into bugs and feature requests
* Provides checklist for both issue templates
* Hides instructions in comments
2022-07-21 16:56:10 +01:00
Iain Sproat 447f28c9f1 Merge pull request #2 from specklesystems/revise-pr-template
Fix: PR template updated to provide detailed instructions
2022-07-21 13:08:23 +01:00
Iain Sproat 1e7291277e Fix link to relative to the repo pull requests 2022-07-21 13:06:25 +01:00
Iain Sproat 46773aa9d3 Add link to speckle-server contribution guide 2022-07-21 12:54:41 +01:00
Iain Sproat 480ea91ebb Fixes: PR template updated to provide detailed instructions 2022-07-21 12:43:28 +01:00
Matteo Cominetti 1c0d6ce8f4 Create close-issue.yml 2021-10-02 17:03:18 +01:00
Matteo Cominetti 1431e306b8 Create open-issue.yml 2021-10-02 17:02:55 +01:00
Dimitrie Stefanescu 83bca13c8b Update README.md 2021-05-23 16:28:34 +01:00
Matteo Cominetti 1bcef9faf6 docs: adds link to docs 2021-02-19 18:40:56 +00:00
Matteo Cominetti 8d3e511d18 docs: removes links to slack 2021-01-06 16:45:48 +00:00
Alan Rynne 162f999100 fix: added yaml frontmatter block to issue template 2020-10-05 17:48:16 +02:00
Alan Rynne 2765c4fa69 Merge pull request #1 from specklesystems/alan/github-folder
Moved relevant files to .github/ folder
2020-10-05 17:35:52 +02:00
Alan Rynne 69cb2c79c7 fix: updated old link 2020-10-05 17:01:14 +02:00
Alan Rynne e2daad36e9 feat: added PR template
Updated docs to reflect it.
2020-10-05 16:58:20 +02:00
Alan Rynne d6b06298ed refactor: moved files to .github/ folder 2020-10-05 16:56:52 +02:00
Matteo Cominetti 7ddd827340 fix: more links 2020-08-21 17:56:51 +01:00
Matteo Cominetti 2a30278e04 fix: link and typos 2020-08-21 17:52:00 +01:00
Dimitrie Stefanescu ecd9089e29 Update README.md 2020-08-21 19:08:32 +03:00
izzy lyseggen bcecaef380 docs: add slack link and badge 2020-08-20 17:11:53 +01:00
Dimitrie Stefanescu 8e986e59aa Update CODE_OF_CONDUCT.md 2020-08-20 18:45:50 +03:00
Dimitrie Stefanescu 9e110a125b Update CONTRIBUTING.md
fixes link
2020-08-20 18:45:35 +03:00
Dimitrie Stefanescu ec8635401b Update README.md 2020-08-20 18:44:18 +03:00
Dimitrie Stefanescu f7b867c219 Update README.md 2020-08-20 18:37:15 +03:00
Dimitrie Stefanescu e69310619e Create LICENSE 2020-08-20 18:21:43 +03:00
Dimitrie Stefanescu 4a924593b3 Update README.md 2020-08-20 18:16:52 +03:00
Dimitrie Stefanescu 1f57e81ddc Update README.md 2020-08-20 18:16:14 +03:00
Dimitrie Stefanescu e42a3d4147 Update README.md 2020-08-20 18:04:36 +03:00
Dimitrie Stefanescu d3d53ef6a5 Update README.md 2020-08-20 18:01:04 +03:00
Dimitrie Stefanescu acb7156bf2 Update README.md
adds basic default social badges - discourse and twitter
2020-08-20 17:56:41 +03:00
Dimitrie Stefanescu 42cda6a477 Update and rename CONTRIBUTING.MD to CONTRIBUTING.md 2020-08-20 17:44:23 +03:00
Dimitrie Stefanescu c1dfe5f11f Update CODE_OF_CONDUCT.md 2020-08-20 17:41:43 +03:00
Dimitrie Stefanescu 7e57b4cfb6 Create ISSUE_TEMPLATE.md 2020-08-20 17:40:39 +03:00
Dimitrie Stefanescu b87237b88f Update CODE_OF_CONDUCT.md
adds authoritative source notice to this repo
2020-08-20 17:28:11 +03:00
Dimitrie Stefanescu fb797e64cb Create CONTRIBUTING.MD 2020-08-20 17:25:04 +03:00
Dimitrie Stefanescu 040a49baea Create CODE_OF_CONDUCT.md 2020-08-20 17:15:20 +03:00
Dimitrie Stefanescu 105ae0316c Initial commit 2020-08-20 17:11:10 +03:00
6 changed files with 646 additions and 8 deletions
-2
View File
@@ -136,8 +136,6 @@ class SpeckleClient:
headers = {
"Authorization": f"Bearer {self.account.token}",
"Content-Type": "application/json",
"apollographql-client-name": metrics.HOST_APP,
"apollographql-client-version": metrics.HOST_APP_VERSION
}
httptransport = RequestsHTTPTransport(
url=self.graphql, headers=headers, verify=True, retries=3
+1 -1
View File
@@ -97,7 +97,7 @@ class ResourceBase(object):
eg (2, 6, 3) for a stable build and (2, 6, 4, 'alpha', 4711) for alpha
"""
if not unsupported_message:
unsupported_message = f"The client method used is not supported on Speckle Server versions prior to v{'.'.join(target_version)}"
unsupported_message = f"The client method used is not supported on Speckle Server versios prior to v{'.'.join(target_version)}"
if self.server_version and self.server_version < target_version:
raise UnsupportedException(unsupported_message)
+1 -1
View File
@@ -466,7 +466,7 @@ class Resource(ResourceBase):
stream_id {str} -- the id of the stream to invite the user to
email {str} -- the email of the user to invite (use this OR `user_id`)
user_id {str} -- the id of the user to invite (use this OR `email`)
role {str} -- the role to assign to the user (defaults to `stream:contributor`)
role {str} -- the role to assing to the user (defaults to `stream:contributor`)
message {str} -- a message to send along with this invite to the specified user
Returns:
+640
View File
@@ -0,0 +1,640 @@
scalar DateTime
scalar EmailAddress
scalar BigInt
scalar JSONObject
directive @hasScope(scope: String!) on FIELD_DEFINITION
directive @hasRole(role: String!) on FIELD_DEFINITION
type Query {
"""
Stare into the void.
"""
_: String
}
type Mutation{
"""
The void stares back.
"""
_: String
}
type Subscription{
"""
It's lonely in the void.
"""
_: String
},extend type Query {
"""
Gets a specific app from the server.
"""
app( id: String! ): ServerApp
"""
Returns all the publicly available apps on this server.
"""
apps: [ServerAppListItem]
}
type ServerApp {
id: String!
secret: String!
name: String!
description: String
termsAndConditionsLink: String
logo: String
public: Boolean
trustByDefault: Boolean
author: AppAuthor
createdAt: DateTime!
redirectUrl: String!
scopes: [Scope]!
}
type ServerAppListItem {
id: String!
name: String!
description: String
termsAndConditionsLink: String
logo: String
author: AppAuthor
}
type AppAuthor {
name: String
id: String
}
extend type User {
"""
Returns the apps you have authorized.
"""
authorizedApps: [ServerAppListItem]
@hasRole(role: "server:user")
@hasScope(scope: "apps:read")
"""
Returns the apps you have created.
"""
createdApps: [ServerAppListItem]
@hasRole(role: "server:user")
@hasScope(scope: "apps:read")
}
extend type Mutation {
"""
Register a new third party application.
"""
appCreate(app: AppCreateInput!): String!
@hasRole(role: "server:user")
@hasScope(scope: "apps:write")
"""
Update an existing third party application. **Note: This will invalidate all existing tokens, refresh tokens and access codes and will require existing users to re-authorize it.**
"""
appUpdate(app: AppUpdateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "apps:write")
"""
Deletes a thirty party application.
"""
appDelete(appId: String!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "apps:write")
"""
Revokes (de-authorizes) an application that you have previously authorized.
"""
appRevokeAccess(appId: String!): Boolean
@hasRole(role: "server:user")
@hasScope(scope: "apps:write")
}
input AppCreateInput {
name: String!
description: String!
termsAndConditionsLink: String
logo: String
public: Boolean
redirectUrl: String!
scopes: [String]!
}
input AppUpdateInput {
id: String!
name: String!
description: String!
termsAndConditionsLink: String
logo: String
public: Boolean
redirectUrl: String!
scopes: [String]!
}
,extend type ServerInfo {
"""
The authentication strategies available on this server.
"""
authStrategies: [AuthStrategy]
}
type AuthStrategy {
id: String!,
name: String!,
icon: String!,
url: String!,
color: String
}
,extend type User{
"""
Returns a list of your personal api tokens.
"""
apiTokens: [ApiToken]
@hasRole(role: "server:user")
@hasScope(scope: "tokens:read")
}
type ApiToken {
id: String!
name: String!
lastChars: String!
scopes: [String]!
createdAt: DateTime! #date
lifespan: BigInt!
lastUsed: String! #date
}
input ApiTokenCreateInput {
scopes: [String!]!,
name: String!,
lifespan: BigInt
}
extend type Mutation {
"""
Creates an personal api token.
"""
apiTokenCreate(token: ApiTokenCreateInput!):String!
@hasRole(role: "server:user")
@hasScope(scope: "tokens:write")
"""
Revokes (deletes) an personal api token.
"""
apiTokenRevoke(token: String!):Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "tokens:write")
}
,extend type Stream {
commits(limit: Int! = 25, cursor: String): CommitCollection
commit(id: String!): Commit
branches(limit: Int! = 25, cursor: String): BranchCollection
branch(name: String!): Branch
}
extend type User {
commits(limit: Int! = 25, cursor: String): CommitCollectionUser
}
type Branch {
id: String!
name: String!
author: User!
description: String
commits(limit: Int! = 25, cursor: String): CommitCollection
}
type Commit {
id: String!
referencedObject: String!
message: String
authorName: String
authorId: String
createdAt: DateTime
}
type CommitCollectionUserNode {
id: String!
referencedObject: String!
message: String
streamId: String
streamName: String
createdAt: DateTime
}
type BranchCollection {
totalCount: Int!
cursor: String
items: [Branch]
}
type CommitCollection {
totalCount: Int!
cursor: String
items: [Commit]
}
type CommitCollectionUser {
totalCount: Int!
cursor: String
items: [CommitCollectionUserNode]
}
extend type Mutation {
branchCreate(branch: BranchCreateInput!): String!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
branchUpdate(branch: BranchUpdateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
branchDelete(branch: BranchDeleteInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitCreate(commit: CommitCreateInput!): String!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitUpdate(commit: CommitUpdateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitDelete(commit: CommitDeleteInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
}
extend type Subscription {
# TODO: auth for these subscriptions
"""
Subscribe to branch created event
"""
branchCreated(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to branch updated event.
"""
branchUpdated(streamId: String!, branchId: String): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to branch deleted event
"""
branchDeleted(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit created event
"""
commitCreated(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit updated event.
"""
commitUpdated(streamId: String!, commitId: String): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit deleted event
"""
commitDeleted(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
}
input BranchCreateInput {
streamId: String!
name: String!
description: String
}
input BranchUpdateInput {
streamId: String!
id: String!
name: String
description: String
}
input BranchDeleteInput {
streamId: String!
id: String!
}
input CommitCreateInput {
streamId: String!
branchName: String!
objectId: String!
message: String
previousCommitIds: [String]
}
input CommitUpdateInput {
streamId: String!
id: String!
message: String!
}
input CommitDeleteInput {
streamId: String!
id: String!
}
,extend type Stream {
object( id: String! ): Object
}
type Object {
id: String!
speckleType: String!
applicationId: String
createdAt: DateTime
totalChildrenCount: Int
"""
The full object, with all its props & other things. **NOTE:** If you're requesting objects for the purpose of recreating & displaying, you probably only want to request this specific field.
"""
data: JSONObject
"""
Get any objects that this object references. In the case of commits, this will give you a commit's constituent objects.
**NOTE**: Providing any of the two last arguments ( `query`, `orderBy` ) will trigger a different code branch that executes a much more expensive SQL query. It is not recommended to do so for basic clients that are interested in purely getting all the objects of a given commit.
"""
children(
limit: Int! = 100,
depth: Int! = 50,
select: [String],
cursor: String,
query: [JSONObject!],
orderBy: JSONObject ): ObjectCollection!
}
type ObjectCollection {
totalCount: Int!
cursor: String
objects: [Object]!
}
extend type Mutation {
objectCreate( objectInput: ObjectCreateInput! ): [String]!
}
input ObjectCreateInput {
"""
The stream against which these objects will be created.
"""
streamId: String!
"""
The objects you want to create.
"""
objects: [JSONObject]!
},extend type Query {
serverInfo: ServerInfo!
}
"""
Information about this server.
"""
type ServerInfo {
name: String!
company: String
description: String
adminContact: String
canonicalUrl: String
termsOfService: String
roles: [Role]!
scopes: [Scope]!
}
"""
Available roles.
"""
type Role {
name: String!
description: String!
resourceTarget: String!
}
"""
Available scopes.
"""
type Scope {
name: String!
description: String!
}
extend type Mutation {
serverInfoUpdate(info: ServerInfoUpdateInput!): Boolean
@hasRole(role: "server:admin")
@hasScope(scope: "server:setup")
}
input ServerInfoUpdateInput {
name: String!
company: String
description: String
adminContact: String
termsOfService: String
}
,extend type Query {
"""
Returns a specific stream.
"""
stream( id: String! ): Stream
"""
All the streams of the current user, pass in the `query` parameter to search by name, description or ID.
"""
streams( query: String, limit: Int = 25, cursor: String ): StreamCollection
@hasScope(scope: "streams:read")
}
type Stream {
id: String!
name: String!
description: String
isPublic: Boolean!
createdAt: DateTime!
updatedAt: DateTime!
collaborators: [ StreamCollaborator ]!
}
extend type User {
"""
All the streams that a user has access to.
"""
streams( limit: Int! = 25, cursor: String ): StreamCollection
}
type StreamCollaborator {
id: String!
name: String!
role: String!
company: String
avatar: String
}
type StreamCollection {
totalCount: Int!
cursor: String
items: [ Stream ]
}
extend type Mutation {
"""
Creates a new stream.
"""
streamCreate( stream: StreamCreateInput! ): String
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Updates an existing stream.
"""
streamUpdate( stream: StreamUpdateInput! ): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Deletes an existing stream.
"""
streamDelete( id: String! ): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Grants permissions to a user on a given stream.
"""
streamGrantPermission( permissionParams: StreamGrantPermissionInput! ): Boolean
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Revokes the permissions of a user on a given stream.
"""
streamRevokePermission( permissionParams: StreamRevokePermissionInput! ): Boolean
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
}
extend type Subscription {
#
# User bound subscriptions that operate on the stream collection of an user
# Example relevant view/usecase: updating the list of streams for a user.
#
"""
Subscribes to new stream added event for your profile. Use this to display an up-to-date list of streams.
**NOTE**: If someone shares a stream with you, this subscription will be triggered with an extra value of `sharedBy` in the payload.
"""
userStreamAdded: JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "profile:read")
"""
Subscribes to stream removed event for your profile. Use this to display an up-to-date list of streams for your profile.
**NOTE**: If someone revokes your permissions on a stream, this subscription will be triggered with an extra value of `revokedBy` in the payload.
"""
userStreamRemoved: JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "profile:read")
#
# Stream bound subscriptions that operate on the stream itself.
# Example relevant view/usecase: a single stream connector, or view, or component in a web app
#
"""
Subscribes to stream updated event. Use this in clients/components that pertain only to this stream.
"""
streamUpdated( streamId: String ): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribes to stream deleted event. Use this in clients/components that pertain only to this stream.
"""
streamDeleted( streamId: String ): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
}
input StreamCreateInput {
name: String
description: String
isPublic: Boolean
}
input StreamUpdateInput {
id: String!
name: String
description: String
isPublic: Boolean
}
input StreamGrantPermissionInput {
streamId: String!,
userId: String!,
role: String!
}
input StreamRevokePermissionInput {
streamId: String!,
userId: String!
}
,extend type Query {
"""
Gets the profile of a user. If no id argument is provided, will return the current authenticated user's profile (as extracted from the authorization header).
"""
user(id: String): User
userSearch(
query: String!
limit: Int! = 25
cursor: String
): UserSearchResultCollection
userPwdStrength(pwd: String!): JSONObject
}
"""
Base user type.
"""
type User {
id: String!
suuid: String
email: String
name: String
bio: String
company: String
avatar: String
verified: Boolean
profiles: JSONObject
role: String
}
type UserSearchResultCollection {
cursor: String
items: [UserSearchResult]
}
type UserSearchResult {
id: String!
name: String
bio: String
company: String
avatar: String
verified: Boolean
}
extend type Mutation {
"""
Edits a user's profile.
"""
userUpdate(user: UserUpdateInput!): Boolean!
}
input UserUpdateInput {
name: String
company: String
bio: String
}
+2 -2
View File
@@ -79,7 +79,7 @@ def track(action: str, account: "Account" = None, custom_props: dict = None):
METRICS_TRACKER.queue.put_nowait(event_params)
except Exception as ex:
# wrapping this whole thing in a try except as we never want a failure here to annoy users!
LOG.debug(f"Error queueing metrics request: {str(ex)}")
LOG.error(f"Error queueing metrics request: {str(ex)}")
def initialise_tracker(account: "Account" = None):
@@ -143,6 +143,6 @@ class MetricsTracker(metaclass=Singleton):
try:
session.post(self.analytics_url, json=event_params)
except Exception as ex:
LOG.debug(f"Error sending metrics request: {str(ex)}")
LOG.error(f"Error sending metrics request: {str(ex)}")
self.queue.task_done()
+2 -2
View File
@@ -42,8 +42,8 @@ class Concrete(Material, speckle_type=STRUCTURAL_MATERIALS + ".Concrete"):
compressiveStrength: float = 0.0
tensileStrength: float = 0.0
flexuralStrength: float = 0.0
maxCompressiveStrain: float = 0.0
maxTensileStrain: float = 0.0
maxCompressiveStrength: float = 0.0
maxTensileStrength: float = 0.0
maxAggregateSize: float = 0.0
lightweight: bool = None