@plitzi/plitzi-builder 0.37.5 → 0.37.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/modules/Builder/Models/TemplateForm.d.ts +9 -9
  3. package/dist/modules/Functions/components/FunctionsOffer/FunctionsOffer.d.ts +12 -0
  4. package/dist/modules/Functions/components/FunctionsOffer/index.d.ts +3 -0
  5. package/dist/modules/Functions/useFunctions.d.ts +1 -0
  6. package/dist/modules/Resources/Models/CdnAccountFields.d.ts +7 -0
  7. package/dist/modules/Resources/Models/CdnBucketFields.d.ts +10 -0
  8. package/dist/modules/Resources/Models/ResourceCdnAccountForm.d.ts +21 -0
  9. package/dist/modules/Resources/Models/ResourceCdnBucketForm.d.ts +28 -0
  10. package/dist/modules/Resources/Models/ResourceCdnForm.d.ts +17 -22
  11. package/dist/modules/Resources/Models/cdnSchemas.d.ts +34 -0
  12. package/dist/modules/Resources/components/Resource/Resource.d.ts +4 -1
  13. package/dist/modules/Resources/components/Resource/subTypes/ResourceServerCode/ResourceServerCode.d.ts +17 -0
  14. package/dist/modules/Resources/components/Resource/subTypes/ResourceServerCode/index.d.ts +3 -0
  15. package/dist/modules/Resources/components/Resource/subTypes/ResourceServerCode/serverCodeKindOf.d.ts +3 -0
  16. package/dist/modules/Resources/components/Resource/subTypes/ResourceServerCode/serverCodeKindOf.test.d.ts +1 -0
  17. package/dist/modules/Resources/components/ResourceManager/ResourceManager.d.ts +3 -1
  18. package/dist/modules/Resources/components/ResourceManager/TemporalResource.d.ts +2 -1
  19. package/dist/modules/Resources/components/ResourcesCdn/ResourcesCdn.d.ts +8 -5
  20. package/dist/modules/Resources/components/ResourcesCdnBucket/ResourcesCdnBucket.d.ts +18 -0
  21. package/dist/modules/Resources/components/ResourcesCdnBucket/index.d.ts +3 -0
  22. package/dist/modules/Resources/components/ResourcesList/ListHelper.d.ts +2 -2
  23. package/dist/modules/Resources/components/ResourcesList/ListHelper.test.d.ts +1 -0
  24. package/dist/modules/Resources/components/ResourcesList/ResourceDirectory.d.ts +2 -1
  25. package/dist/modules/Resources/components/ResourcesList/ResourcesList.d.ts +5 -2
  26. package/dist/package.json.d.ts +1 -1
  27. package/dist/plitzi-builder.css +1 -1
  28. package/dist/plitzi-builder.css.gz +0 -0
  29. package/dist/plitzi-builder.js +1336 -1316
  30. package/dist/plitzi-builder.js.gz +0 -0
  31. package/package.json +15 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # @plitzi/plitzi-builder
2
2
 
3
+ ## 0.37.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 4d10e0a: ## CDNs with several buckets
8
+
9
+ A CDN is the customer's own storage account — S3 or R2, which they run and pay for — and now holds any number of
10
+ buckets, each with its own configuration: its name at the provider, its region, `public` (served at its domain) or
11
+ `private` (no domain, read only by the platform with the CDN's credential).
12
+
13
+ - `Cdn` carries `buckets: CdnBucket[]`; `domain`, `visibility`, `bucketName` and `region` moved from the CDN to its
14
+ buckets. `Resource.bucketIdentifier` names the bucket a file is in.
15
+ - `SpaceAddCdn(name, provider, endpoint, buckets)` creates the account with its buckets; `SpaceUpdateCdn` changes the
16
+ account only. New `SpaceAddCdnBucket`, `SpaceUpdateCdnBucket` and `SpaceRemoveCdnBucket`.
17
+ - `SpaceResources`, `SpaceAddResource`, `SpaceRemoveResource` and `SpaceMoveResource` take `bucketIdentifier`.
18
+ - Server code — functions and runtime — goes in the space's oldest private bucket. A bucket that keeps code a version
19
+ runs can be neither made public, pointed at another bucket nor removed, and neither can its CDN.
20
+ - Builder: Resources shows each CDN with its buckets — add, edit and remove buckets, upload and browse per bucket; the
21
+ account (name, provider, endpoint, credential) is edited apart. Saving an element as a template picks a public
22
+ bucket (`elementAsTemplate({ cdnIdentifier, bucketIdentifier }, …)`).
23
+ - CLI: `plitzi upload plugin --bucket <identifier>` (with `--cdn` to narrow); only public buckets are offered, a private
24
+ one is refused.
25
+
26
+ - Updated dependencies [4d10e0a]
27
+ - @plitzi/sdk-auth@0.37.7
28
+ - @plitzi/sdk-authoring@0.37.7
29
+ - @plitzi/sdk-dev-tools@0.37.7
30
+ - @plitzi/sdk-elements@0.37.7
31
+ - @plitzi/sdk-event-bridge@0.37.7
32
+ - @plitzi/sdk-interactions@0.37.7
33
+ - @plitzi/sdk-navigation@0.37.7
34
+ - @plitzi/sdk-plugins@0.37.7
35
+ - @plitzi/sdk-schema@0.37.7
36
+ - @plitzi/sdk-shared@0.37.7
37
+ - @plitzi/sdk-style@0.37.7
38
+ - @plitzi/sdk-variables@0.37.7
39
+ - @plitzi/plitzi-sdk@0.37.7
40
+
41
+ ## 0.37.6
42
+
43
+ ### Patch Changes
44
+
45
+ - d6c2a21: ## Server code on a private CDN
46
+
47
+ - **A CDN has a visibility**: `public` (the default — its files served at its domain: plugins, images, templates) or
48
+ `private` (no domain, read only by the platform with its credential). The builder's CDN form asks for it, and every
49
+ CDN now has **Settings** in Resources to change its configuration — until now a CDN could not be edited at all.
50
+ - **A space's server code is kept on its private CDN**, not in the platform's database: its functions' source and
51
+ bundle, and its runtime's packed code, named by what they hold. Saving functions or pushing a runtime to a space with
52
+ no private CDN is refused with how to add one (`FunctionsRefusal.limit: 'storage'`). Resources lists them under
53
+ **Server code** with the versions that run each (`Resource.usedBy`, `ResourceType` `server`); one in use cannot be
54
+ removed. A private CDN cannot take a page's file, and `plitzi upload plugin` offers only public CDNs.
55
+ - **A space made from a template** gets the template's functions as an offer (`FunctionsDraft.offer`): the Functions
56
+ panel installs them (`SpaceInstallTemplateFunctions`) once the space has a private CDN.
57
+ - Types: `Cdn.visibility`, `CdnVisibility`; `SpaceAddCdn` / `SpaceUpdateCdn` take `visibility` and a nullable `domain`.
58
+
59
+ - Updated dependencies [d6c2a21]
60
+ - @plitzi/sdk-auth@0.37.6
61
+ - @plitzi/sdk-authoring@0.37.6
62
+ - @plitzi/sdk-dev-tools@0.37.6
63
+ - @plitzi/sdk-elements@0.37.6
64
+ - @plitzi/sdk-event-bridge@0.37.6
65
+ - @plitzi/sdk-interactions@0.37.6
66
+ - @plitzi/sdk-navigation@0.37.6
67
+ - @plitzi/sdk-plugins@0.37.6
68
+ - @plitzi/sdk-schema@0.37.6
69
+ - @plitzi/sdk-shared@0.37.6
70
+ - @plitzi/sdk-style@0.37.6
71
+ - @plitzi/sdk-variables@0.37.6
72
+ - @plitzi/plitzi-sdk@0.37.6
73
+
3
74
  ## 0.37.5
4
75
 
5
76
  ### Patch Changes
@@ -1,16 +1,16 @@
1
- import { z } from 'zod';
2
1
  import { MouseEvent } from 'react';
3
- declare const templateFormSchema: z.ZodObject<{
4
- name: z.ZodString;
5
- description: z.ZodOptional<z.ZodString>;
6
- cdnIdentifier: z.ZodString;
7
- }, z.core.$strip>;
2
+ /** What the form answers: the template, and the public bucket of which CDN it goes in. */
3
+ export type TemplateFormValues = {
4
+ name: string;
5
+ description?: string;
6
+ cdnIdentifier: string;
7
+ bucketIdentifier: string;
8
+ };
8
9
  export type TemplateFormProps = {
9
10
  name?: string;
10
11
  description?: string;
11
- cdnIdentifier?: string;
12
12
  onClose?: (e?: MouseEvent) => void;
13
- onSubmit?: (e: MouseEvent | undefined, values: z.infer<typeof templateFormSchema>) => void;
13
+ onSubmit?: (e: MouseEvent | undefined, values: TemplateFormValues) => void;
14
14
  };
15
- declare const TemplateForm: ({ name, description, cdnIdentifier, onSubmit, onClose }: TemplateFormProps) => import('react').JSX.Element;
15
+ declare const TemplateForm: ({ name, description, onSubmit, onClose }: TemplateFormProps) => import('react').JSX.Element;
16
16
  export default TemplateForm;
@@ -0,0 +1,12 @@
1
+ export type FunctionsOfferProps = {
2
+ /** The template's name. */
3
+ template: string;
4
+ isInstalling?: boolean;
5
+ onInstall?: () => void;
6
+ };
7
+ /**
8
+ * The functions the space's template brought, offered to install: a space made from a template has no private bucket to
9
+ * keep server code on at first, so they wait here until it has one. Installing saves them as the space's own.
10
+ */
11
+ declare const FunctionsOffer: ({ template, isInstalling, onInstall }: FunctionsOfferProps) => import('react').JSX.Element;
12
+ export default FunctionsOffer;
@@ -0,0 +1,3 @@
1
+ import { default as FunctionsOffer } from './FunctionsOffer';
2
+ export * from './FunctionsOffer';
3
+ export default FunctionsOffer;
@@ -8,6 +8,7 @@ declare const useFunctions: () => {
8
8
  error: string;
9
9
  isLoading: boolean;
10
10
  save: (files: FunctionsDraft["files"]) => Promise<FunctionsSaveResult | undefined>;
11
+ install: () => Promise<FunctionsSaveResult | undefined>;
11
12
  remove: () => Promise<void>;
12
13
  tryTask: (task: string, params: Record<string, unknown>) => Promise<ActionRunReport | undefined>;
13
14
  };
@@ -0,0 +1,7 @@
1
+ export type CdnAccountFieldsProps = {
2
+ provider: string;
3
+ onChangeProvider?: (value: string) => void;
4
+ };
5
+ /** A CDN account's fields — its name, its provider and, on R2, its endpoint — inside a form that holds them. */
6
+ declare const CdnAccountFields: ({ provider, onChangeProvider }: CdnAccountFieldsProps) => import('react').JSX.Element;
7
+ export default CdnAccountFields;
@@ -0,0 +1,10 @@
1
+ export type CdnBucketFieldsProps = {
2
+ provider: string;
3
+ visibility: string;
4
+ };
5
+ /**
6
+ * A bucket's fields — the bucket as the provider knows it, its region on S3, who may read it and, when public, where —
7
+ * inside a form that holds them.
8
+ */
9
+ declare const CdnBucketFields: ({ provider, visibility }: CdnBucketFieldsProps) => import('react').JSX.Element;
10
+ export default CdnBucketFields;
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { MouseEvent } from 'react';
3
+ declare const resourceCdnAccountFormSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ provider: z.ZodEnum<{
6
+ s3: "s3";
7
+ r2: "r2";
8
+ }>;
9
+ endpoint: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export type ResourceCdnAccountFormValues = z.infer<typeof resourceCdnAccountFormSchema>;
12
+ export type ResourceCdnAccountFormProps = {
13
+ name: string;
14
+ provider: 's3' | 'r2';
15
+ endpoint?: string;
16
+ onClose?: (e?: MouseEvent) => void;
17
+ onSubmit?: (e: MouseEvent | undefined, values: ResourceCdnAccountFormValues) => void;
18
+ };
19
+ /** A CDN's account — its name, provider and endpoint. Its buckets are changed one by one. */
20
+ declare const ResourceCdnAccountForm: ({ name, provider, endpoint, onSubmit, onClose }: ResourceCdnAccountFormProps) => import('react').JSX.Element;
21
+ export default ResourceCdnAccountForm;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { CdnVisibility } from '@plitzi/sdk-shared';
3
+ import { MouseEvent } from 'react';
4
+ declare const bucketFormSchemaFor: (provider: "s3" | "r2") => z.ZodObject<{
5
+ bucketName: z.ZodString;
6
+ region: z.ZodOptional<z.ZodString>;
7
+ visibility: z.ZodEnum<{
8
+ public: "public";
9
+ private: "private";
10
+ }>;
11
+ domain: z.ZodOptional<z.ZodString>;
12
+ name: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export type ResourceCdnBucketFormValues = z.infer<ReturnType<typeof bucketFormSchemaFor>>;
15
+ export type ResourceCdnBucketFormProps = {
16
+ /** The provider of the CDN it belongs to: an S3 bucket has a region of its own. */
17
+ provider: 's3' | 'r2';
18
+ name?: string;
19
+ bucketName?: string;
20
+ region?: string;
21
+ visibility?: CdnVisibility;
22
+ domain?: string;
23
+ onClose?: (e?: MouseEvent) => void;
24
+ onSubmit?: (e: MouseEvent | undefined, values: ResourceCdnBucketFormValues) => void;
25
+ };
26
+ /** A bucket of a CDN, added or changed: what the builder calls it, and its configuration. */
27
+ declare const ResourceCdnBucketForm: ({ provider, name, bucketName, region, visibility, domain, onSubmit, onClose }: ResourceCdnBucketFormProps) => import('react').JSX.Element;
28
+ export default ResourceCdnBucketForm;
@@ -1,30 +1,25 @@
1
1
  import { z } from 'zod';
2
2
  import { MouseEvent } from 'react';
3
- declare const resourceCdnFormSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
- provider: z.ZodLiteral<"s3">;
5
- name: z.ZodString;
6
- domain: z.ZodString;
7
- region: z.ZodString;
8
- endpoint: z.ZodOptional<z.ZodString>;
3
+ /** A new CDN: the customer's storage account and its first bucket — more are added to it afterwards. */
4
+ declare const resourceCdnFormSchema: z.ZodObject<{
9
5
  bucketName: z.ZodString;
10
- }, z.core.$strip>, z.ZodObject<{
11
- provider: z.ZodLiteral<"r2">;
6
+ region: z.ZodOptional<z.ZodString>;
7
+ visibility: z.ZodEnum<{
8
+ public: "public";
9
+ private: "private";
10
+ }>;
11
+ domain: z.ZodOptional<z.ZodString>;
12
12
  name: z.ZodString;
13
- domain: z.ZodString;
14
- region: z.ZodDefault<z.ZodString>;
15
- endpoint: z.ZodString;
16
- bucketName: z.ZodString;
17
- }, z.core.$strip>], "provider">;
13
+ provider: z.ZodEnum<{
14
+ s3: "s3";
15
+ r2: "r2";
16
+ }>;
17
+ endpoint: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type ResourceCdnFormValues = z.infer<typeof resourceCdnFormSchema>;
18
20
  export type ResourceCdnFormProps = {
19
- className?: string;
20
- name?: string;
21
- domain?: string;
22
- provider?: 's3' | 'r2';
23
- region?: string;
24
- endpoint?: string;
25
- bucketName?: string;
26
21
  onClose?: (e?: MouseEvent) => void;
27
- onSubmit?: (e: MouseEvent | undefined, values: z.infer<typeof resourceCdnFormSchema>) => void;
22
+ onSubmit?: (e: MouseEvent | undefined, values: ResourceCdnFormValues) => void;
28
23
  };
29
- declare const ResourceCdnForm: ({ name, domain, provider, region, endpoint, bucketName, onSubmit, onClose }: ResourceCdnFormProps) => import('react').JSX.Element;
24
+ declare const ResourceCdnForm: ({ onSubmit, onClose }: ResourceCdnFormProps) => import('react').JSX.Element;
30
25
  export default ResourceCdnForm;
@@ -0,0 +1,34 @@
1
+ import { z, RefinementCtx } from 'zod';
2
+ /** A CDN's account, as its forms take it: the customer's storage account — provider, and where R2 reaches it. */
3
+ export declare const cdnAccountShape: {
4
+ name: z.ZodString;
5
+ provider: z.ZodEnum<{
6
+ s3: "s3";
7
+ r2: "r2";
8
+ }>;
9
+ endpoint: z.ZodOptional<z.ZodString>;
10
+ };
11
+ /** A bucket's configuration, as its forms take it. */
12
+ export declare const cdnBucketShape: {
13
+ bucketName: z.ZodString;
14
+ region: z.ZodOptional<z.ZodString>;
15
+ visibility: z.ZodEnum<{
16
+ public: "public";
17
+ private: "private";
18
+ }>;
19
+ domain: z.ZodOptional<z.ZodString>;
20
+ };
21
+ /** What an account needs beyond its shape: R2 is reached at an endpoint of its own. */
22
+ export declare const checkCdnAccount: ({ provider, endpoint }: {
23
+ provider: "s3" | "r2";
24
+ endpoint?: string;
25
+ }, ctx: RefinementCtx) => void;
26
+ /**
27
+ * What a bucket needs beyond its shape: an S3 bucket lives in a region of its own, and a public bucket is read at its
28
+ * domain — a private one has none: only Plitzi reads it, with the CDN's credential.
29
+ */
30
+ export declare const checkCdnBucket: (provider: "s3" | "r2", { region, visibility, domain }: {
31
+ region?: string;
32
+ visibility: "public" | "private";
33
+ domain?: string;
34
+ }, ctx: RefinementCtx) => void;
@@ -3,13 +3,16 @@ export type ResourceProps = {
3
3
  className?: string;
4
4
  id: string;
5
5
  cdnIdentifier: string;
6
+ bucketIdentifier: string;
6
7
  type?: TResourceType;
7
8
  src?: string;
8
9
  title?: string;
9
10
  metadata?: PluginManifest;
11
+ /** For server code, the versions of the space that run it. */
12
+ usedBy?: string[];
10
13
  directoryName?: string;
11
14
  isLoading?: boolean;
12
15
  onRemove?: (id: string) => void;
13
16
  };
14
- declare const Resource: ({ className, id, cdnIdentifier, type, src, title, metadata, directoryName, isLoading, onRemove }: ResourceProps) => import('react').JSX.Element;
17
+ declare const Resource: ({ className, id, cdnIdentifier, bucketIdentifier, type, src, title, metadata, usedBy, directoryName, isLoading, onRemove }: ResourceProps) => import('react').JSX.Element;
15
18
  export default Resource;
@@ -0,0 +1,17 @@
1
+ import { MouseEvent } from 'react';
2
+ export type ResourceServerCodeProps = {
3
+ className?: string;
4
+ id: string;
5
+ /** The versions of the space that run it: while any does, it cannot be removed. */
6
+ usedBy?: string[];
7
+ removing?: boolean;
8
+ isLoading?: boolean;
9
+ onRemove?: (e: MouseEvent) => void;
10
+ };
11
+ /**
12
+ * A file of the space's server code in its private bucket — its functions or its runtime, kept by saves and pushes
13
+ * and named by what it holds. No preview and no address: a private bucket serves nothing. What it shows is which
14
+ * versions run it, so what nothing runs any more can be cleared from here.
15
+ */
16
+ declare const ResourceServerCode: ({ className, id, usedBy, removing, isLoading, onRemove }: ResourceServerCodeProps) => import('react').JSX.Element;
17
+ export default ResourceServerCode;
@@ -0,0 +1,3 @@
1
+ import { default as ResourceServerCode } from './ResourceServerCode';
2
+ export * from './ResourceServerCode';
3
+ export default ResourceServerCode;
@@ -0,0 +1,3 @@
1
+ /** What a file of server code is, read from where it is kept (`<space>/server/<folder>/<digest>`). */
2
+ declare const serverCodeKindOf: (id: string) => string;
3
+ export default serverCodeKindOf;
@@ -2,9 +2,11 @@ import { ResourceFile, ResourceWithFile } from '@plitzi/sdk-shared';
2
2
  export type ResourceManagerProps = {
3
3
  className?: string;
4
4
  cdnIdentifier?: string;
5
+ /** Which of the CDN's buckets the files go in — a public one. */
6
+ bucketIdentifier?: string;
5
7
  uploadTypes?: string[];
6
8
  onUploaded?: (resource: ResourceWithFile) => void;
7
9
  onUploadAdded?: (file: ResourceFile) => boolean;
8
10
  };
9
- declare const ResourceManager: ({ className, cdnIdentifier, uploadTypes, onUploaded, onUploadAdded }: ResourceManagerProps) => import('react').JSX.Element;
11
+ declare const ResourceManager: ({ className, cdnIdentifier, bucketIdentifier, uploadTypes, onUploaded, onUploadAdded }: ResourceManagerProps) => import('react').JSX.Element;
10
12
  export default ResourceManager;
@@ -2,6 +2,7 @@ import { PluginManifest, ResourceFile, ResourceType as TResourceType, ResourceWi
2
2
  export type TemporalResourceProps = {
3
3
  className?: string;
4
4
  cdnIdentifier?: string;
5
+ bucketIdentifier?: string;
5
6
  id?: string;
6
7
  file?: ResourceFile;
7
8
  type?: TResourceType;
@@ -11,5 +12,5 @@ export type TemporalResourceProps = {
11
12
  onUploadCancel?: (file: File) => void;
12
13
  onError?: (e: Error) => void;
13
14
  };
14
- declare const TemporalResource: ({ cdnIdentifier, id, type, title, className, file, metadata, onUploaded, onError: onErrorProp, onUploadCancel }: TemporalResourceProps) => import('react').JSX.Element;
15
+ declare const TemporalResource: ({ cdnIdentifier, bucketIdentifier, id, type, title, className, file, metadata, onUploaded, onError: onErrorProp, onUploadCancel }: TemporalResourceProps) => import('react').JSX.Element;
15
16
  export default TemporalResource;
@@ -1,12 +1,15 @@
1
+ import { Cdn } from '@plitzi/sdk-shared';
1
2
  export type ResourcesCdnProps = {
2
- identifier: string;
3
- name: string;
4
- prefix: string;
5
- credentialIdentifier?: string;
3
+ /** The CDN as the space's list gives it: its account and its buckets. */
4
+ cdn: Cdn;
6
5
  isCollapsed?: boolean;
7
6
  onCollapse?: (category: string, isCollapsed: boolean) => void;
8
7
  onChange?: (identifier: string) => void;
9
8
  onRemove?: (identifier: string) => void;
10
9
  };
11
- declare const ResourcesCdn: ({ identifier, name, prefix, credentialIdentifier, isCollapsed, onCollapse, onChange, onRemove }: ResourcesCdnProps) => import('react').JSX.Element;
10
+ /**
11
+ * A CDN — the customer's own storage account — and its buckets, each with its own configuration and files. The account
12
+ * holds the credential every bucket is opened with.
13
+ */
14
+ declare const ResourcesCdn: ({ cdn, isCollapsed, onCollapse, onChange, onRemove }: ResourcesCdnProps) => import('react').JSX.Element;
12
15
  export default ResourcesCdn;
@@ -0,0 +1,18 @@
1
+ import { CdnBucket } from '@plitzi/sdk-shared';
2
+ export type ResourcesCdnBucketProps = {
3
+ cdnIdentifier: string;
4
+ /** The CDN's provider: what a bucket's settings ask for depends on it. */
5
+ provider: 's3' | 'r2';
6
+ bucket: CdnBucket;
7
+ /** The folder every file of the space is kept under in its buckets. */
8
+ prefix: string;
9
+ /** The CDN changed — a bucket added, edited or removed — and its list is read again. */
10
+ onChange?: () => void;
11
+ };
12
+ /**
13
+ * One bucket of a CDN and the space's files in it. A public one takes uploads — plugins, images, templates — and serves
14
+ * them at its domain; a private one keeps the space's server code, written when it is saved or pushed, and serves
15
+ * nothing.
16
+ */
17
+ declare const ResourcesCdnBucket: ({ cdnIdentifier, provider, bucket, prefix, onChange }: ResourcesCdnBucketProps) => import('react').JSX.Element;
18
+ export default ResourcesCdnBucket;
@@ -0,0 +1,3 @@
1
+ import { default as ResourcesCdnBucket } from './ResourcesCdnBucket';
2
+ export * from './ResourcesCdnBucket';
3
+ export default ResourcesCdnBucket;
@@ -1,5 +1,5 @@
1
1
  import { ResourceDirectory } from './ResourcesList';
2
- import { Resource } from '@plitzi/sdk-shared';
2
+ import { CdnVisibility, Resource } from '@plitzi/sdk-shared';
3
3
  declare const sortDirectories: (a: ResourceDirectory, b: ResourceDirectory) => number;
4
- declare const getDirectories: (prefix?: string, items?: Resource[]) => ResourceDirectory[];
4
+ declare const getDirectories: (prefix?: string, items?: Resource[], visibility?: CdnVisibility) => ResourceDirectory[];
5
5
  export { getDirectories, sortDirectories };
@@ -7,9 +7,10 @@ export type ResourcesDirectoryProps = {
7
7
  canDrop?: boolean;
8
8
  canRemove?: boolean;
9
9
  cdnIdentifier: string;
10
+ bucketIdentifier: string;
10
11
  onChange?: () => void;
11
12
  onRemove?: (item: TResource) => void;
12
13
  onRemoveDirectory?: (name?: string) => void;
13
14
  };
14
- declare const ResourceDirectory: ({ className, name, items, isDefault, canRemove, canDrop, cdnIdentifier, onChange, onRemove, onRemoveDirectory }: ResourcesDirectoryProps) => import('react').JSX.Element;
15
+ declare const ResourceDirectory: ({ className, name, items, isDefault, canRemove, canDrop, cdnIdentifier, bucketIdentifier, onChange, onRemove, onRemoveDirectory }: ResourcesDirectoryProps) => import('react').JSX.Element;
15
16
  export default ResourceDirectory;
@@ -1,9 +1,12 @@
1
- import { Resource as TResource } from '@plitzi/sdk-shared';
1
+ import { CdnVisibility, Resource as TResource } from '@plitzi/sdk-shared';
2
2
  export type ResourcesListProps = {
3
3
  className?: string;
4
4
  items: TResource[];
5
5
  prefix: string;
6
6
  cdnIdentifier: string;
7
+ bucketIdentifier: string;
8
+ /** A private bucket takes no upload: it lists its server code, and offers no folder to add. */
9
+ visibility?: CdnVisibility;
7
10
  onChange?: () => void;
8
11
  onRemove?: (item: TResource) => void;
9
12
  };
@@ -14,5 +17,5 @@ export type ResourceDirectory = {
14
17
  isDefault: boolean;
15
18
  canRemove: boolean;
16
19
  };
17
- declare const ResourcesList: ({ className, prefix, items, cdnIdentifier, onChange, onRemove }: ResourcesListProps) => import('react').JSX.Element;
20
+ declare const ResourcesList: ({ className, prefix, items, cdnIdentifier, bucketIdentifier, visibility, onChange, onRemove }: ResourcesListProps) => import('react').JSX.Element;
18
21
  export default ResourcesList;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@plitzi/plitzi-builder",
3
- "version": "0.37.5",
3
+ "version": "0.37.7",
4
4
  "homepage": "./",
5
5
  "license": "AGPL-3.0",
6
6
  "files": [