@hubspot/local-dev-lib 3.3.1-beta.0 → 3.3.2-beta.0

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.
@@ -1,8 +1,8 @@
1
- import { FetchSchemasResponse, Schema, CreateObjectsResponse } from '../types/Schemas';
1
+ import { FetchSchemasResponse, Schema, SchemaDefinition, ObjectDefinition, CreateObjectsResponse } from '../types/Schemas';
2
2
  import { HubSpotPromise } from '../types/Http';
3
- export declare function batchCreateObjects(accountId: number, objectTypeId: string, objects: JSON): HubSpotPromise<CreateObjectsResponse>;
4
- export declare function createObjectSchema(accountId: number, schema: JSON): HubSpotPromise<Schema>;
5
- export declare function updateObjectSchema(accountId: number, schemaObjectType: string, schema: Schema): HubSpotPromise<Schema>;
3
+ export declare function batchCreateObjects(accountId: number, objectTypeId: string, objects: ObjectDefinition): HubSpotPromise<CreateObjectsResponse>;
4
+ export declare function createObjectSchema(accountId: number, schema: SchemaDefinition): HubSpotPromise<Schema>;
5
+ export declare function updateObjectSchema(accountId: number, schemaObjectType: string, schema: SchemaDefinition): HubSpotPromise<Schema>;
6
6
  export declare function fetchObjectSchema(accountId: number, schemaObjectType: string): HubSpotPromise<Schema>;
7
7
  export declare function fetchObjectSchemas(accountId: number): HubSpotPromise<FetchSchemasResponse>;
8
8
  export declare function deleteObjectSchema(accountId: number, schemaObjectType: string): HubSpotPromise<void>;
package/lib/github.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  import { GithubReleaseData, GithubRepoFile, RepoPath, CloneGithubRepoOptions } from '../types/Github';
3
+ /**
4
+ * @deprecated Use `fetchRepoFile` instead - this util is a thin wrapper around it
5
+ */
3
6
  export declare function fetchFileFromRepository<T = Buffer>(repoPath: RepoPath, filePath: string, ref: string): Promise<T>;
4
7
  export declare function fetchReleaseData(repoPath: RepoPath, tag?: string): Promise<GithubReleaseData>;
5
8
  export declare function cloneGithubRepo(repoPath: RepoPath, dest: string, options?: CloneGithubRepoOptions): Promise<boolean>;
package/lib/github.js CHANGED
@@ -12,6 +12,9 @@ const github_1 = require("../api/github");
12
12
  const lang_1 = require("../utils/lang");
13
13
  const errors_1 = require("../errors");
14
14
  const i18nKey = 'lib.github';
15
+ /**
16
+ * @deprecated Use `fetchRepoFile` instead - this util is a thin wrapper around it
17
+ */
15
18
  async function fetchFileFromRepository(repoPath, filePath, ref) {
16
19
  try {
17
20
  logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.fetchFileFromRepository.fetching`, {
@@ -75,14 +78,17 @@ async function downloadGithubRepoZip(repoPath, isRelease = false, options = {})
75
78
  }
76
79
  }
77
80
  async function cloneGithubRepo(repoPath, dest, options = {}) {
78
- const { tag, isRelease, branch, sourceDir, type } = options;
81
+ const { tag, isRelease, branch, sourceDir, type, hideLogs } = options;
79
82
  const zip = await downloadGithubRepoZip(repoPath, isRelease, {
80
83
  tag,
81
84
  branch,
82
85
  });
83
86
  const repoName = repoPath.split('/')[1];
84
- const success = await (0, archive_1.extractZipArchive)(zip, repoName, dest, { sourceDir });
85
- if (success) {
87
+ const success = await (0, archive_1.extractZipArchive)(zip, repoName, dest, {
88
+ sourceDir,
89
+ hideLogs,
90
+ });
91
+ if (success && !hideLogs) {
86
92
  logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.cloneGithubRepo.success`, {
87
93
  type: type || '',
88
94
  dest,
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "3.3.1-beta.0",
3
+ "version": "3.3.2-beta.0",
4
4
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
5
- "main": "lib/index.js",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "https://github.com/HubSpot/hubspot-local-dev-lib"
package/types/Github.d.ts CHANGED
@@ -72,5 +72,6 @@ export type CloneGithubRepoOptions = {
72
72
  branch?: string;
73
73
  tag?: string;
74
74
  sourceDir?: string;
75
+ hideLogs?: boolean;
75
76
  };
76
77
  export {};
@@ -37,3 +37,47 @@ export type CreateObjectsResponse = {
37
37
  archived: boolean;
38
38
  }>;
39
39
  };
40
+ export type SchemaDefinition = {
41
+ allowsSensitiveProperties?: boolean;
42
+ associatedObjects?: Array<string>;
43
+ description?: string;
44
+ labels: {
45
+ plural: string;
46
+ singular: string;
47
+ };
48
+ searchableProperties?: Array<string>;
49
+ secondaryDisplayProperties?: Array<string>;
50
+ name: string;
51
+ primaryDisplayProperty?: string;
52
+ properties: [
53
+ {
54
+ isPrimaryDisplayLabel: true;
55
+ label: string;
56
+ name: string;
57
+ }
58
+ ];
59
+ requiredProperties: Array<string>;
60
+ };
61
+ export type ObjectDefinition = {
62
+ inputs: [
63
+ {
64
+ associations?: [
65
+ {
66
+ types: [
67
+ {
68
+ associationCategory: string;
69
+ associationTypeId: number;
70
+ }
71
+ ];
72
+ to: {
73
+ id: string;
74
+ };
75
+ }
76
+ ];
77
+ objectWriteTraceId?: number;
78
+ properties: {
79
+ [key: string]: string;
80
+ };
81
+ }
82
+ ];
83
+ };