Socket
Socket
Sign inDemoInstall

@stackbit/types

Package Overview
Dependencies
Maintainers
12
Versions
291
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackbit/types - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

41

dist/content-source.d.ts

@@ -6,3 +6,3 @@ /// <reference types="node" />

import type { Logger } from './logger';
import type { Document, Asset, TypeDocument, TypeAsset } from './content-source-document';
import type { Document, Asset, TypeDocument, TypeAsset, DocumentStatus } from './content-source-document';
import type { UpdateOperation, UpdateOperationField } from './content-source-operation';

@@ -110,2 +110,39 @@ export interface ContentSourceInterface<UserContext = unknown, DocumentContext = unknown, AssetContext = unknown> {

}
export declare type RunResult = {
stdout: string;
stderr: string;
exitCode?: number;
err?: Error;
};
export declare type CommandRunner = (command: string, args?: string[], options?: {
cwd?: string;
shell?: boolean;
env?: NodeJS.ProcessEnv;
}) => Promise<RunResult>;
export interface GitFileCommitDescriptor {
filePath: string;
description: string;
}
export interface GitAuthor {
name?: string;
email: string;
}
export interface GitCommitLogEntry {
author: string;
timestamp: Date;
commitHash: string;
changes: {
status: DocumentStatus;
filePath: string;
}[];
}
export interface GitServiceInterface {
getRepoUrl(): string;
getRepoBranch(): string;
getRepoPublishBranch(): string;
commitAndPush: (author: GitAuthor, files: GitFileCommitDescriptor[]) => Promise<void>;
publish(author: GitAuthor, filePaths?: string[]): Promise<void>;
commitLog(): Promise<GitCommitLogEntry[]>;
diff(): Promise<string[]>;
}
export interface InitOptions {

@@ -118,2 +155,4 @@ logger: Logger;

devAppRestartNeeded?: () => void;
git: GitServiceInterface;
runCommand: CommandRunner;
}

@@ -120,0 +159,0 @@ export declare type UserCommandSpawner = (options: SpawnUserCommandOptions) => ChildProcessWithoutNullStreams;

4

package.json
{
"name": "@stackbit/types",
"version": "0.2.0",
"version": "0.3.0",
"description": "Types for Stackbit config and Content Source Interface",

@@ -42,3 +42,3 @@ "main": "dist/index.js",

},
"gitHead": "fe959112061432c1ef5981a0e7f15b1c75b788ed"
"gitHead": "a04ff1f665119bd1e9d2e6603a36288b1f944dbe"
}
import type { ChildProcessWithoutNullStreams } from 'child_process';
import type { Model } from './models';
import type { Logger } from './logger';
import type { Document, Asset, TypeDocument, TypeAsset } from './content-source-document';
import type { Document, Asset, TypeDocument, TypeAsset, DocumentStatus } from './content-source-document';
import type { UpdateOperation, UpdateOperationField } from './content-source-operation';

@@ -32,6 +32,3 @@

onWebhook?(data: {
data: unknown;
headers: Record<string, string>;
}): void;
onWebhook?(data: { data: unknown; headers: Record<string, string> }): void;

@@ -113,2 +110,36 @@ onFilesChange?({

export type RunResult = { stdout: string; stderr: string; exitCode?: number; err?: Error };
export type CommandRunner = (command: string, args?: string[], options?: { cwd?: string; shell?: boolean; env?: NodeJS.ProcessEnv }) => Promise<RunResult>;
export interface GitFileCommitDescriptor {
filePath: string;
description: string;
}
export interface GitAuthor {
name?: string;
email: string;
}
export interface GitCommitLogEntry {
author: string;
timestamp: Date;
commitHash: string;
changes: {
status: DocumentStatus;
filePath: string;
}[];
}
export interface GitServiceInterface {
getRepoUrl(): string;
getRepoBranch(): string;
getRepoPublishBranch(): string;
commitAndPush: (author: GitAuthor, files: GitFileCommitDescriptor[]) => Promise<void>;
publish(author: GitAuthor, filePaths?: string[]): Promise<void>;
commitLog(): Promise<GitCommitLogEntry[]>;
diff(): Promise<string[]>;
}
export interface InitOptions {

@@ -121,2 +152,4 @@ logger: Logger;

devAppRestartNeeded?: () => void;
git: GitServiceInterface;
runCommand: CommandRunner;
}

@@ -123,0 +156,0 @@

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