From 940ab93575793f90df9b8d255dd74e062af8b8ca Mon Sep 17 00:00:00 2001 From: sam-codaio <102985674+sam-codaio@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:05:01 -0400 Subject: [PATCH] Create AllUsers Principal and deprecate Anyone Principal (#3091) --- dist/bundle.d.ts | 22 ++++++++++++++++++++-- dist/schema.d.ts | 22 ++++++++++++++++++++-- dist/schema.js | 5 +++++ package.json | 2 +- schema.ts | 22 ++++++++++++++++++++-- 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/dist/bundle.d.ts b/dist/bundle.d.ts index dd3c6d2f1d..f140187a20 100644 --- a/dist/bundle.d.ts +++ b/dist/bundle.d.ts @@ -2175,7 +2175,12 @@ export interface ObjectSchemaDefinition exte declare enum PrincipalType { User = "user", Group = "group", + /** + * @deprecated + * @hidden + */ Anyone = "anyone", + AllUsers = "allUsers", Domain = "domain" } /** @@ -2211,21 +2216,34 @@ export interface DomainPrincipal { /** * This represents a principal corresponding to anyone * - * Generally this would apply to an entity where anyone with access to the url can view the item + * Generally this would apply to an entity where anyone with access to the url can view the item. + * Deprecated in favor of {@link AllUsersPrincipal}. Will be removed in a future SDK version. * * TODO(sam): Unhide this + * @deprecated * @hidden */ export interface AnyonePrincipal { type: PrincipalType.Anyone; } +/** + * This represents a principal corresponding to anyone who has access to the external system. + * + * This corresponds to any user who appears in the sync table with role {@link TableRole.Users} + * + * TODO(sam): Unhide this + * @hidden + */ +export interface AllUsersPrincipal { + type: PrincipalType.AllUsers; +} /** * This represents a principal that can be granted access. * * TODO(sam): Unhide this * @hidden */ -export type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal; +export type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal | AllUsersPrincipal; declare enum PermissionType { Delegated = "delegated", Direct = "direct" diff --git a/dist/schema.d.ts b/dist/schema.d.ts index 2edcfa59bc..5523ef547a 100644 --- a/dist/schema.d.ts +++ b/dist/schema.d.ts @@ -1206,7 +1206,12 @@ export interface ObjectSchemaDefinition exte export declare enum PrincipalType { User = "user", Group = "group", + /** + * @deprecated + * @hidden + */ Anyone = "anyone", + AllUsers = "allUsers", Domain = "domain" } /** @@ -1242,21 +1247,34 @@ export interface DomainPrincipal { /** * This represents a principal corresponding to anyone * - * Generally this would apply to an entity where anyone with access to the url can view the item + * Generally this would apply to an entity where anyone with access to the url can view the item. + * Deprecated in favor of {@link AllUsersPrincipal}. Will be removed in a future SDK version. * * TODO(sam): Unhide this + * @deprecated * @hidden */ export interface AnyonePrincipal { type: PrincipalType.Anyone; } +/** + * This represents a principal corresponding to anyone who has access to the external system. + * + * This corresponds to any user who appears in the sync table with role {@link TableRole.Users} + * + * TODO(sam): Unhide this + * @hidden + */ +export interface AllUsersPrincipal { + type: PrincipalType.AllUsers; +} /** * This represents a principal that can be granted access. * * TODO(sam): Unhide this * @hidden */ -type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal; +type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal | AllUsersPrincipal; /** * The type of permission. * Delegated permissions are permissions that are inherited from another object that aren't diff --git a/dist/schema.js b/dist/schema.js index e9dc88dd34..c3ffc1123b 100644 --- a/dist/schema.js +++ b/dist/schema.js @@ -395,7 +395,12 @@ var PrincipalType; (function (PrincipalType) { PrincipalType["User"] = "user"; PrincipalType["Group"] = "group"; + /** + * @deprecated + * @hidden + */ PrincipalType["Anyone"] = "anyone"; + PrincipalType["AllUsers"] = "allUsers"; PrincipalType["Domain"] = "domain"; })(PrincipalType || (exports.PrincipalType = PrincipalType = {})); /** diff --git a/package.json b/package.json index 3916faf98b..25e183fb46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codahq/packs-sdk", - "version": "1.8.1-prerelease.3", + "version": "1.8.1-prerelease.4", "license": "MIT", "workspaces": [ "dev/eslint" diff --git a/schema.ts b/schema.ts index 09ad339fef..71bca3c33c 100644 --- a/schema.ts +++ b/schema.ts @@ -1386,7 +1386,12 @@ export interface ObjectSchemaDefinition export enum PrincipalType { User = 'user', Group = 'group', + /** + * @deprecated + * @hidden + */ Anyone = 'anyone', + AllUsers = 'allUsers', Domain = 'domain', } @@ -1426,22 +1431,35 @@ export interface DomainPrincipal { /** * This represents a principal corresponding to anyone * - * Generally this would apply to an entity where anyone with access to the url can view the item + * Generally this would apply to an entity where anyone with access to the url can view the item. + * Deprecated in favor of {@link AllUsersPrincipal}. Will be removed in a future SDK version. * * TODO(sam): Unhide this + * @deprecated * @hidden */ export interface AnyonePrincipal { type: PrincipalType.Anyone; } +/** + * This represents a principal corresponding to anyone who has access to the external system. + * + * This corresponds to any user who appears in the sync table with role {@link TableRole.Users} + * + * TODO(sam): Unhide this + * @hidden + */ +export interface AllUsersPrincipal { + type: PrincipalType.AllUsers; +} /** * This represents a principal that can be granted access. * * TODO(sam): Unhide this * @hidden */ -type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal; +type Principal = UserPrincipal | GroupPrincipal | AnyonePrincipal | DomainPrincipal | AllUsersPrincipal; /** * The type of permission.