New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@plone/client

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plone/client - npm Package Compare versions

Comparing version 1.0.0-alpha.17 to 1.0.0-alpha.18

2

package.json

@@ -11,3 +11,3 @@ {

"license": "MIT",
"version": "1.0.0-alpha.17",
"version": "1.0.0-alpha.18",
"repository": {

@@ -14,0 +14,0 @@ "type": "git",

import { z } from 'zod';
import { ApiRequestParams, apiRequest } from '../../API';
import {
PloneClientConfig,
PloneClientConfigSchema,
} from '../../validation/config';
import { PloneClientConfig } from '../../validation/config';
import { copyMoveDataSchema as copyDataSchema } from '../../validation/copymove';
import { CopyMoveResponse as CopyResponse } from '@plone/types';
export const copyArgsSchema = z.object({
data: copyDataSchema,
config: PloneClientConfigSchema,
});
export type CopyArgs = z.infer<typeof copyDataSchema> & {
config: PloneClientConfig;
};
export type CopyArgs = z.infer<typeof copyArgsSchema>;
export const copy = async ({
path,
data,
config,
}: CopyArgs): Promise<CopyResponse> => {
const validatedArgs = copyArgsSchema.parse({
const validatedArgs = copyDataSchema.parse({
path,
data,
config,
});
const options: ApiRequestParams = {
config,
data: validatedArgs.data,
config: validatedArgs.config,
};
return apiRequest('post', '/@copy', options);
const copyPath = `${validatedArgs.path}/@copy`;
return apiRequest('post', copyPath, options);
};

@@ -36,3 +33,4 @@

mutationKey: ['post', 'copy'],
mutationFn: ({ data }: Omit<CopyArgs, 'config'>) => copy({ data, config }),
mutationFn: ({ path, data }: Omit<CopyArgs, 'config'>) =>
copy({ path, data, config }),
});
import { z } from 'zod';
import { ApiRequestParams, apiRequest } from '../../API';
import {
PloneClientConfig,
PloneClientConfigSchema,
} from '../../validation/config';
import { PloneClientConfig } from '../../validation/config';
import { copyMoveDataSchema as moveDataSchema } from '../../validation/copymove';
import { CopyMoveResponse as MoveResponse } from '@plone/types';
export const MoveArgsSchema = z.object({
path: z.string(),
data: moveDataSchema,
config: PloneClientConfigSchema,
});
export type MoveArgs = z.infer<typeof moveDataSchema> & {
config: PloneClientConfig;
};
export type MoveArgs = z.infer<typeof MoveArgsSchema>;
export const move = async ({

@@ -23,14 +16,13 @@ path,

}: MoveArgs): Promise<MoveResponse> => {
const validatedArgs = MoveArgsSchema.parse({
const validatedArgs = moveDataSchema.parse({
path,
data,
config,
});
const options: ApiRequestParams = {
config,
data: validatedArgs.data,
config: validatedArgs.config,
};
const movePath = `/${validatedArgs.path}/@move`;
const movePath = `${validatedArgs.path}/@move`;

@@ -37,0 +29,0 @@ return apiRequest('post', movePath, options);

import { z } from 'zod';
export const copyMoveDataSchema = z.object({
source: z.union([z.string(), z.array(z.string())]),
path: z.string(),
data: z.object({
source: z.union([z.string(), z.array(z.string())]),
}),
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc