@marsson/ciutils 0.0.13 → 0.1.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,5 +1,104 @@
1
1
  {
2
2
  "commands": {
3
+ "create:file": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "This command always creates a new file in the org; you can't update an existing file. After a successful upload, the command displays the ID of the new ContentDocument record which represents the uploaded file.\n\nBy default, the uploaded file isn't attached to a record; in the Salesforce UI the file shows up in the Files tab. You can optionally attach the file to an existing record, such as an account, as long as you know its record ID.\n\nYou can also give the file a new name after it's been uploaded; by default its name in the org is the same as the local file name.",
7
+ "examples": [
8
+ "Upload the local file \"resources/astro.png\" to your default org:\n<%= config.bin %> <%= command.id %> --file resources/astro.png",
9
+ "Give the file a different filename after it's uploaded to the org with alias \"my-scratch\":\n<%= config.bin %> <%= command.id %> --file resources/astro.png --title AstroOnABoat.png --target-org my-scratch",
10
+ "Attach the file to a record in the org:\n<%= config.bin %> <%= command.id %> --file path/to/astro.png --parent-id a03fakeLoJWPIA3"
11
+ ],
12
+ "flags": {
13
+ "json": {
14
+ "description": "Format output as json.",
15
+ "helpGroup": "GLOBAL",
16
+ "name": "json",
17
+ "allowNo": false,
18
+ "type": "boolean"
19
+ },
20
+ "flags-dir": {
21
+ "helpGroup": "GLOBAL",
22
+ "name": "flags-dir",
23
+ "summary": "Import flag values from a directory.",
24
+ "hasDynamicHelp": false,
25
+ "multiple": false,
26
+ "type": "option"
27
+ },
28
+ "target-org": {
29
+ "char": "o",
30
+ "name": "target-org",
31
+ "noCacheDefault": true,
32
+ "required": true,
33
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
34
+ "hasDynamicHelp": true,
35
+ "multiple": false,
36
+ "type": "option"
37
+ },
38
+ "api-version": {
39
+ "description": "Override the api version used for api requests made by this command",
40
+ "name": "api-version",
41
+ "hasDynamicHelp": false,
42
+ "multiple": false,
43
+ "type": "option"
44
+ },
45
+ "title": {
46
+ "char": "t",
47
+ "name": "title",
48
+ "required": false,
49
+ "summary": "New title given to the file (ContentDocument) after it's uploaded.",
50
+ "hasDynamicHelp": false,
51
+ "multiple": false,
52
+ "type": "option"
53
+ },
54
+ "file": {
55
+ "char": "f",
56
+ "name": "file",
57
+ "required": true,
58
+ "summary": "Path of file to upload.",
59
+ "hasDynamicHelp": false,
60
+ "multiple": false,
61
+ "type": "option"
62
+ },
63
+ "parent-id": {
64
+ "char": "i",
65
+ "name": "parent-id",
66
+ "summary": "ID of the record to attach the file to.",
67
+ "hasDynamicHelp": false,
68
+ "multiple": false,
69
+ "type": "option"
70
+ },
71
+ "created-date": {
72
+ "char": "c",
73
+ "name": "created-date",
74
+ "summary": "Datetime value in ISO 8601 format (e.g., 2024-08-09T15:30:00Z).",
75
+ "hasDynamicHelp": false,
76
+ "multiple": false,
77
+ "type": "option"
78
+ }
79
+ },
80
+ "hasDynamicHelp": true,
81
+ "hiddenAliases": [],
82
+ "id": "create:file",
83
+ "pluginAlias": "@marsson/ciutils",
84
+ "pluginName": "@marsson/ciutils",
85
+ "pluginType": "core",
86
+ "strict": true,
87
+ "summary": "Upload a local file to an org.",
88
+ "enableJsonFlag": true,
89
+ "isESM": true,
90
+ "relativePath": [
91
+ "lib",
92
+ "commands",
93
+ "create",
94
+ "file.js"
95
+ ],
96
+ "aliasPermutations": [],
97
+ "permutations": [
98
+ "create:file",
99
+ "file:create"
100
+ ]
101
+ },
3
102
  "remove:assignments": {
4
103
  "aliases": [],
5
104
  "args": {},
@@ -160,7 +259,87 @@
160
259
  "reporton:deployment",
161
260
  "deployment:reporton"
162
261
  ]
262
+ },
263
+ "validate:repository:metadata": {
264
+ "aliases": [],
265
+ "args": {},
266
+ "description": "More information about a command. Don't repeat the summary.",
267
+ "examples": [
268
+ "<%= config.bin %> <%= command.id %>"
269
+ ],
270
+ "flags": {
271
+ "json": {
272
+ "description": "Format output as json.",
273
+ "helpGroup": "GLOBAL",
274
+ "name": "json",
275
+ "allowNo": false,
276
+ "type": "boolean"
277
+ },
278
+ "flags-dir": {
279
+ "helpGroup": "GLOBAL",
280
+ "name": "flags-dir",
281
+ "summary": "Import flag values from a directory.",
282
+ "hasDynamicHelp": false,
283
+ "multiple": false,
284
+ "type": "option"
285
+ },
286
+ "name": {
287
+ "char": "n",
288
+ "description": "More information about a flag. Don't repeat the summary.",
289
+ "name": "name",
290
+ "required": false,
291
+ "summary": "Description of a flag.",
292
+ "hasDynamicHelp": false,
293
+ "multiple": false,
294
+ "type": "option"
295
+ },
296
+ "target-org": {
297
+ "char": "o",
298
+ "name": "target-org",
299
+ "noCacheDefault": true,
300
+ "required": true,
301
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
302
+ "hasDynamicHelp": true,
303
+ "multiple": false,
304
+ "type": "option"
305
+ },
306
+ "folder": {
307
+ "char": "f",
308
+ "name": "folder",
309
+ "required": true,
310
+ "summary": "The path to the deployment folder (ex. force-app/main/default/obects).",
311
+ "hasDynamicHelp": false,
312
+ "multiple": false,
313
+ "type": "option"
314
+ }
315
+ },
316
+ "hasDynamicHelp": true,
317
+ "hiddenAliases": [],
318
+ "id": "validate:repository:metadata",
319
+ "pluginAlias": "@marsson/ciutils",
320
+ "pluginName": "@marsson/ciutils",
321
+ "pluginType": "core",
322
+ "strict": true,
323
+ "summary": "Summary of a command.",
324
+ "enableJsonFlag": true,
325
+ "isESM": true,
326
+ "relativePath": [
327
+ "lib",
328
+ "commands",
329
+ "validate",
330
+ "repository",
331
+ "metadata.js"
332
+ ],
333
+ "aliasPermutations": [],
334
+ "permutations": [
335
+ "validate:repository:metadata",
336
+ "repository:validate:metadata",
337
+ "repository:metadata:validate",
338
+ "validate:metadata:repository",
339
+ "metadata:validate:repository",
340
+ "metadata:repository:validate"
341
+ ]
163
342
  }
164
343
  },
165
- "version": "0.0.13"
344
+ "version": "0.1.0"
166
345
  }
package/package.json CHANGED
@@ -1,27 +1,30 @@
1
1
  {
2
2
  "name": "@marsson/ciutils",
3
3
  "description": " Utilities for enabling continuous integration for Salesforce development under SF CLI",
4
- "version": "0.0.13",
4
+ "version": "0.1.0",
5
5
  "dependencies": {
6
- "@oclif/core": "^3.26.2",
7
- "@salesforce/core": "^7.2.0",
8
- "@salesforce/sf-plugins-core": "^9.0.1",
6
+ "@oclif/core": "^4",
7
+ "@salesforce/core": "^8",
8
+ "@salesforce/plugin-deploy-retrieve": "^3.19.0",
9
+ "@salesforce/sf-plugins-core": "^12",
9
10
  "cli-progress": "^3.12.0",
10
11
  "cli-table3": "^0.6.3",
12
+ "form-data": "^4.0.0",
11
13
  "jsforce": "2.0.0-beta.29",
12
14
  "moment": "^2.30.1",
13
15
  "yarn": "^1.22.22"
14
16
  },
15
17
  "devDependencies": {
16
- "@oclif/plugin-command-snapshot": "^5.1.4",
17
- "@salesforce/cli-plugins-testkit": "^5.2.0",
18
- "@salesforce/dev-scripts": "^9.0.0",
18
+ "@oclif/plugin-command-snapshot": "^5.1.9",
19
+ "@salesforce/cli-plugins-testkit": "^5.3.39",
20
+ "@salesforce/dev-scripts": "^10.2.11",
21
+ "@types/cli-progress": "^3.11.6",
19
22
  "@types/jsforce": "^1.11.5",
20
- "eslint-plugin-sf-plugin": "^1.18.1",
21
- "oclif": "^4.8.1",
23
+ "eslint-plugin-sf-plugin": "^1.18.6",
24
+ "oclif": "^4.14.0",
22
25
  "shx": "0.3.4",
23
26
  "ts-node": "^10.9.2",
24
- "typescript": "^5.4.5"
27
+ "typescript": "^5.6.3"
25
28
  },
26
29
  "engines": {
27
30
  "node": ">=18.0.0"
@@ -58,6 +61,14 @@
58
61
  },
59
62
  "remove": {
60
63
  "description": "description for remove"
64
+ },
65
+ "validate": {
66
+ "description": "description for validate",
67
+ "subtopics": {
68
+ "repository": {
69
+ "description": "description for validate.repository"
70
+ }
71
+ }
61
72
  }
62
73
  },
63
74
  "flexibleTaxonomy": true
@@ -1,20 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type RemoveAssignmentsResult = {
3
- path: string;
4
- };
5
- export default class RemoveAssignments extends SfCommand<RemoveAssignmentsResult> {
6
- static readonly summary: string;
7
- static readonly description: string;
8
- static readonly examples: string[];
9
- static readonly flags: {
10
- name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- object: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<("PermissionSet" | "Group" | "PermissionSetGroup")[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
- usernames: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
- 'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
- };
15
- private connection;
16
- run(): Promise<RemoveAssignmentsResult>;
17
- private matchUsersAndGenerateOrgUserList;
18
- private processHandler;
19
- private finalize;
20
- }
@@ -1,27 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { DeployResult } from 'jsforce/api/metadata';
3
- export type ReportonDeploymentResult = DeployResult;
4
- export default class ReportonDeployment extends SfCommand<ReportonDeploymentResult> {
5
- static readonly summary: string;
6
- static readonly description: string;
7
- static readonly examples: string[];
8
- static readonly flags: {
9
- 'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- deploymentid: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- awaitcompletion: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
- };
13
- private connection;
14
- private deploymentStatus;
15
- private multiBar;
16
- private b1;
17
- private b2;
18
- private isComplete;
19
- run(): Promise<ReportonDeploymentResult>;
20
- private awaitDeploymentCompletion;
21
- private updateDeployResult;
22
- private updateProgressBars;
23
- private displayHeader;
24
- private printDeploymentReport;
25
- private printErrors;
26
- private printSuccess;
27
- }
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
@@ -1,61 +0,0 @@
1
- import { Connection } from '@salesforce/core';
2
- import { RecordResult } from 'jsforce/record-result.js';
3
- declare class AssignmentHelper {
4
- }
5
- declare enum ProcessStatus {
6
- SUCCESS = 0,
7
- FAILURE = 1,
8
- UNPROCCESSED = 2
9
- }
10
- declare class OrgDetails {
11
- private static MARSSON_EXCEPTION_APEX;
12
- private static isASandbox;
13
- private static sandboxName;
14
- static isSandbox(con: Connection): Promise<boolean>;
15
- static getSandboxName(con: Connection): Promise<string | void>;
16
- }
17
- declare class UserNameOrg {
18
- username: string | undefined;
19
- orgUsername: string | undefined;
20
- userId: string | undefined;
21
- error: UserNameOrgError | undefined;
22
- groups: UnassignableObject[];
23
- permissionsets: UnassignableObject[];
24
- permissionsetgroups: UnassignableObject[];
25
- constructor(orgName: string | void, username: string);
26
- }
27
- declare enum UserNameOrgError {
28
- NO_ERROR = "",
29
- USER_NOT_FOUND = "Username not found in org"
30
- }
31
- declare class UnassignableObject {
32
- static OBJECT_CONVERT: Map<string, string>;
33
- unassinableType: string;
34
- objectid: string;
35
- parentId: string;
36
- processStatus: ProcessStatus;
37
- errorMessage: string | undefined;
38
- constructor(unasObject: string, objId: string, parentId: string);
39
- static createUnassignablesforGroups(groups: SObject[]): UnassignableObject[];
40
- static createUnassignablesforPermissionSet(groups: SObject[]): UnassignableObject[];
41
- static createUnassignablesforPermissionSetGroup(groups: SObject[]): UnassignableObject[];
42
- }
43
- declare class BatchDownloadHelper {
44
- static fetchAllUsers(conn: Connection): Promise<SObject[]>;
45
- static fetchMultipleObjectsInParallell(conn: Connection): Promise<{
46
- users: SObject[];
47
- groupmembers: SObject[];
48
- permissionsets: SObject[];
49
- permissionsetgroups: SObject[];
50
- }>;
51
- static deleteObjectsFromUnassignableObjects(conn: Connection, unassignableObjects: UnassignableObject[]): Promise<void>;
52
- static bulkDeleteRecords(conn: Connection, records: SObject[], objectType: string): Promise<RecordResult[]>;
53
- static updateUnassignableDeletionResult(records: SObject[], results: RecordResult[], unassignableObjects: UnassignableObject[]): void;
54
- private static bulkQuery;
55
- }
56
- interface SObject {
57
- [key: string]: unknown;
58
- Id: string;
59
- }
60
- declare function mapSObjectsByKeyField(sobjects: SObject[], keyField: string): Map<string, SObject[]>;
61
- export { OrgDetails, UserNameOrg, BatchDownloadHelper, AssignmentHelper, mapSObjectsByKeyField, UnassignableObject, SObject, UserNameOrgError, };