From c5a2801bea17be95d33549ac7b1a03910e258e15 Mon Sep 17 00:00:00 2001 From: "Paul K." Date: Tue, 1 Apr 2025 23:09:41 -0400 Subject: [PATCH] feat: add identity type for project --- packages/connections/README.MD | 2 +- packages/connections/src/client/index.ts | 6 +- packages/connections/src/types/index.d.ts | 76 +++++++++++------------ packages/types/embed-tokens.ts | 4 +- packages/types/links.ts | 4 +- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/packages/connections/README.MD b/packages/connections/README.MD index c3fc6b7..c06d99e 100644 --- a/packages/connections/README.MD +++ b/packages/connections/README.MD @@ -33,7 +33,7 @@ app.post("/authkit-token", async (request, response) => { You'll want to switch out the API Key for your own, which will later tell your frontend which integrations you'd like to make available to your users. -If you pass an `identity` or `identityType` (`user`, `team`, or `organization`), you'll be able to query for all connections scoped to that identity. The identity is used to generate the unique [Connection Key](https://docs.picaos.com/docs/setup) for the user once they successfully connect an account. +If you pass an `identity` or `identityType` (`user`, `team`, `organization`, or `project`), you'll be able to query for all connections scoped to that identity. The identity is used to generate the unique [Connection Key](https://docs.picaos.com/docs/setup) for the user once they successfully connect an account. ## Full Documentation diff --git a/packages/connections/src/client/index.ts b/packages/connections/src/client/index.ts index 264bbc7..4162ee8 100644 --- a/packages/connections/src/client/index.ts +++ b/packages/connections/src/client/index.ts @@ -39,10 +39,10 @@ export class AuthKitToken { * @remarks It is recommended to avoid using spaces and colons in this field as it may lead to unexpected behavior in some systems. */ identity?: string; - identityType?: "user" | "team" | "organization"; - /** @deprecated Use 'identity' instead */ + identityType?: "user" | "team" | "organization" | "project"; + /** @deprecated Use 'identity' instead */ group?: string; - /** @deprecated */ + /** @deprecated */ label?: string; }) { const secret = this._clientInfo.secret; diff --git a/packages/connections/src/types/index.d.ts b/packages/connections/src/types/index.d.ts index b261c32..4ab20b3 100644 --- a/packages/connections/src/types/index.d.ts +++ b/packages/connections/src/types/index.d.ts @@ -18,7 +18,7 @@ export interface EventLink { version: string; ownership: Ownership; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; group?: string; label?: string; token: string; @@ -37,7 +37,7 @@ export type CreateEventLinkPayload = { environment?: string; usageSource?: string; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; group?: string; label?: string; }; @@ -123,34 +123,34 @@ export interface Feature { } export interface ConnectionRecord { - _id: string; - platformVersion: string; - connectionDefinitionId: string; - name: string; - key: string; - environment: string; - platform: string; - secretsServiceId: string; - settings: { - parseWebhookBody: boolean; - showSecret: boolean; - allowCustomEvents: boolean; - oauth: boolean; - }; - throughput: { - key: string; - limit: number; - }; - createdAt: number; - updatedAt: number; - updated: boolean; - version: string; - lastModifiedBy: string; - deleted: boolean; - changeLog: Record; // You can replace 'any' with a more specific type if needed - tags: string[]; - active: boolean; - deprecated: boolean; + _id: string; + platformVersion: string; + connectionDefinitionId: string; + name: string; + key: string; + environment: string; + platform: string; + secretsServiceId: string; + settings: { + parseWebhookBody: boolean; + showSecret: boolean; + allowCustomEvents: boolean; + oauth: boolean; + }; + throughput: { + key: string; + limit: number; + }; + createdAt: number; + updatedAt: number; + updated: boolean; + version: string; + lastModifiedBy: string; + deleted: boolean; + changeLog: Record; // You can replace 'any' with a more specific type if needed + tags: string[]; + active: boolean; + deprecated: boolean; } @@ -162,7 +162,7 @@ export interface EmbedTokenRecord { group?: string; label?: string; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; createdAt: number; createdDate: Date; updatedAt?: number; @@ -170,13 +170,13 @@ export interface EmbedTokenRecord { environment: string; features?: Feature[]; sessionId: string; - _id?: string; - formData?: object; - response?: { - isConnected: boolean; - message?: string; - connection?: ConnectionRecord; - } + _id?: string; + formData?: object; + response?: { + isConnected: boolean; + message?: string; + connection?: ConnectionRecord; + } } export interface LinkSettings { diff --git a/packages/types/embed-tokens.ts b/packages/types/embed-tokens.ts index d5c5102..5df5345 100644 --- a/packages/types/embed-tokens.ts +++ b/packages/types/embed-tokens.ts @@ -27,7 +27,7 @@ export interface EmbedTokensPayload { label?: string; group?: string; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; environment: string; ttl: number; sessionId: string; @@ -41,7 +41,7 @@ export interface EmbedTokenRecord { }; features?: Feature[]; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; label?: string; group?: string; createdAt: number; diff --git a/packages/types/links.ts b/packages/types/links.ts index 15dec5c..e556df3 100644 --- a/packages/types/links.ts +++ b/packages/types/links.ts @@ -10,7 +10,7 @@ export type CreateEventLinkPayload = { environment?: string; usageSource?: string; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; group?: string; label?: string; }; @@ -20,7 +20,7 @@ export interface EventLink { version: string; ownership: Ownership; identity?: string; - identityType?: 'user' | 'team' | 'organization'; + identityType?: 'user' | 'team' | 'organization' | 'project'; group?: string; label?: string; token: string;