bulkyard 1.0.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.
- package/LICENSE +28 -0
- package/README.md +136 -0
- package/lib/commands/bulkyard/extract.d.ts +18 -0
- package/lib/commands/bulkyard/extract.js +84 -0
- package/lib/commands/bulkyard/extract.js.map +1 -0
- package/lib/commands/bulkyard/load.d.ts +19 -0
- package/lib/commands/bulkyard/load.js +98 -0
- package/lib/commands/bulkyard/load.js.map +1 -0
- package/lib/core/config.d.ts +23 -0
- package/lib/core/config.js +52 -0
- package/lib/core/config.js.map +1 -0
- package/lib/core/database.d.ts +15 -0
- package/lib/core/database.js +67 -0
- package/lib/core/database.js.map +1 -0
- package/lib/core/extractor.d.ts +11 -0
- package/lib/core/extractor.js +33 -0
- package/lib/core/extractor.js.map +1 -0
- package/lib/core/loader.d.ts +13 -0
- package/lib/core/loader.js +59 -0
- package/lib/core/loader.js.map +1 -0
- package/lib/core/type-map.d.ts +1 -0
- package/lib/core/type-map.js +32 -0
- package/lib/core/type-map.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/messages/bulkyard.extract.md +55 -0
- package/messages/bulkyard.load.md +59 -0
- package/oclif.lock +7821 -0
- package/oclif.manifest.json +252 -0
- package/package.json +191 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"bulkyard:extract": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Reads a YAML config file to determine which objects to query, then uses Bulk API 2.0 to extract records and write them to a local SQLite database. Each object is stored in its own table.\n\nAlternatively, use --sobject and --query to extract a single object without a config file.",
|
|
7
|
+
"examples": [
|
|
8
|
+
"Extract data using a config file:\n<%= config.bin %> <%= command.id %> --target-org myOrg --config-file bulkyard.config.yml",
|
|
9
|
+
"Extract a single object inline:\n<%= config.bin %> <%= command.id %> --target-org myOrg --sobject Account --query \"SELECT Id, Name FROM Account\"",
|
|
10
|
+
"Extract inline with a custom database and table name:\n<%= config.bin %> <%= command.id %> --target-org myOrg -s Account -q \"SELECT Id, Name FROM Account\" -d my.db -t Account_Backup"
|
|
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
|
+
"config-file": {
|
|
46
|
+
"char": "c",
|
|
47
|
+
"name": "config-file",
|
|
48
|
+
"summary": "Path to the YAML config file.",
|
|
49
|
+
"hasDynamicHelp": false,
|
|
50
|
+
"multiple": false,
|
|
51
|
+
"type": "option"
|
|
52
|
+
},
|
|
53
|
+
"sobject": {
|
|
54
|
+
"char": "s",
|
|
55
|
+
"name": "sobject",
|
|
56
|
+
"summary": "Salesforce object API name (e.g. Account, Contact).",
|
|
57
|
+
"hasDynamicHelp": false,
|
|
58
|
+
"multiple": false,
|
|
59
|
+
"type": "option"
|
|
60
|
+
},
|
|
61
|
+
"query": {
|
|
62
|
+
"char": "q",
|
|
63
|
+
"dependsOn": [
|
|
64
|
+
"sobject"
|
|
65
|
+
],
|
|
66
|
+
"name": "query",
|
|
67
|
+
"summary": "SOQL query to execute for extraction.",
|
|
68
|
+
"hasDynamicHelp": false,
|
|
69
|
+
"multiple": false,
|
|
70
|
+
"type": "option"
|
|
71
|
+
},
|
|
72
|
+
"database": {
|
|
73
|
+
"char": "d",
|
|
74
|
+
"exclusive": [
|
|
75
|
+
"config-file"
|
|
76
|
+
],
|
|
77
|
+
"name": "database",
|
|
78
|
+
"summary": "Path to the SQLite database file.",
|
|
79
|
+
"default": "bulkyard.db",
|
|
80
|
+
"hasDynamicHelp": false,
|
|
81
|
+
"multiple": false,
|
|
82
|
+
"type": "option"
|
|
83
|
+
},
|
|
84
|
+
"table": {
|
|
85
|
+
"char": "t",
|
|
86
|
+
"dependsOn": [
|
|
87
|
+
"sobject"
|
|
88
|
+
],
|
|
89
|
+
"name": "table",
|
|
90
|
+
"summary": "SQLite table name override (defaults to the object name).",
|
|
91
|
+
"hasDynamicHelp": false,
|
|
92
|
+
"multiple": false,
|
|
93
|
+
"type": "option"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"hasDynamicHelp": true,
|
|
97
|
+
"hiddenAliases": [],
|
|
98
|
+
"id": "bulkyard:extract",
|
|
99
|
+
"pluginAlias": "bulkyard",
|
|
100
|
+
"pluginName": "bulkyard",
|
|
101
|
+
"pluginType": "core",
|
|
102
|
+
"strict": true,
|
|
103
|
+
"summary": "Extract data from a Salesforce org into a local SQLite database using Bulk API 2.0.",
|
|
104
|
+
"enableJsonFlag": true,
|
|
105
|
+
"isESM": true,
|
|
106
|
+
"relativePath": [
|
|
107
|
+
"lib",
|
|
108
|
+
"commands",
|
|
109
|
+
"bulkyard",
|
|
110
|
+
"extract.js"
|
|
111
|
+
],
|
|
112
|
+
"aliasPermutations": [],
|
|
113
|
+
"permutations": [
|
|
114
|
+
"bulkyard:extract",
|
|
115
|
+
"extract:bulkyard"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"bulkyard:load": {
|
|
119
|
+
"aliases": [],
|
|
120
|
+
"args": {},
|
|
121
|
+
"description": "Reads a YAML config file to determine which tables to load, then uses Bulk API 2.0 to insert, update, or upsert records from a local SQLite database into the target Salesforce org.\n\nAlternatively, use --sobject and --operation to load a single object without a config file.",
|
|
122
|
+
"examples": [
|
|
123
|
+
"Load data using a config file:\n<%= config.bin %> <%= command.id %> --target-org myOrg --config-file bulkyard.config.yml",
|
|
124
|
+
"Load a single object inline:\n<%= config.bin %> <%= command.id %> --target-org myOrg --sobject Account --operation upsert --external-id-field Id",
|
|
125
|
+
"Load inline with a custom database and table name:\n<%= config.bin %> <%= command.id %> --target-org myOrg -s Account -p insert -d my.db -t Account_Staging"
|
|
126
|
+
],
|
|
127
|
+
"flags": {
|
|
128
|
+
"json": {
|
|
129
|
+
"description": "Format output as json.",
|
|
130
|
+
"helpGroup": "GLOBAL",
|
|
131
|
+
"name": "json",
|
|
132
|
+
"allowNo": false,
|
|
133
|
+
"type": "boolean"
|
|
134
|
+
},
|
|
135
|
+
"flags-dir": {
|
|
136
|
+
"helpGroup": "GLOBAL",
|
|
137
|
+
"name": "flags-dir",
|
|
138
|
+
"summary": "Import flag values from a directory.",
|
|
139
|
+
"hasDynamicHelp": false,
|
|
140
|
+
"multiple": false,
|
|
141
|
+
"type": "option"
|
|
142
|
+
},
|
|
143
|
+
"target-org": {
|
|
144
|
+
"char": "o",
|
|
145
|
+
"name": "target-org",
|
|
146
|
+
"noCacheDefault": true,
|
|
147
|
+
"required": true,
|
|
148
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
149
|
+
"hasDynamicHelp": true,
|
|
150
|
+
"multiple": false,
|
|
151
|
+
"type": "option"
|
|
152
|
+
},
|
|
153
|
+
"api-version": {
|
|
154
|
+
"description": "Override the api version used for api requests made by this command",
|
|
155
|
+
"name": "api-version",
|
|
156
|
+
"hasDynamicHelp": false,
|
|
157
|
+
"multiple": false,
|
|
158
|
+
"type": "option"
|
|
159
|
+
},
|
|
160
|
+
"config-file": {
|
|
161
|
+
"char": "c",
|
|
162
|
+
"name": "config-file",
|
|
163
|
+
"summary": "Path to the YAML config file.",
|
|
164
|
+
"hasDynamicHelp": false,
|
|
165
|
+
"multiple": false,
|
|
166
|
+
"type": "option"
|
|
167
|
+
},
|
|
168
|
+
"sobject": {
|
|
169
|
+
"char": "s",
|
|
170
|
+
"name": "sobject",
|
|
171
|
+
"summary": "Salesforce object API name (e.g. Account, Contact).",
|
|
172
|
+
"hasDynamicHelp": false,
|
|
173
|
+
"multiple": false,
|
|
174
|
+
"type": "option"
|
|
175
|
+
},
|
|
176
|
+
"operation": {
|
|
177
|
+
"char": "p",
|
|
178
|
+
"dependsOn": [
|
|
179
|
+
"sobject"
|
|
180
|
+
],
|
|
181
|
+
"name": "operation",
|
|
182
|
+
"summary": "Bulk API operation: insert, update, upsert, or delete.",
|
|
183
|
+
"hasDynamicHelp": false,
|
|
184
|
+
"multiple": false,
|
|
185
|
+
"options": [
|
|
186
|
+
"insert",
|
|
187
|
+
"update",
|
|
188
|
+
"upsert",
|
|
189
|
+
"delete"
|
|
190
|
+
],
|
|
191
|
+
"type": "option"
|
|
192
|
+
},
|
|
193
|
+
"external-id-field": {
|
|
194
|
+
"char": "e",
|
|
195
|
+
"dependsOn": [
|
|
196
|
+
"sobject"
|
|
197
|
+
],
|
|
198
|
+
"name": "external-id-field",
|
|
199
|
+
"summary": "External ID field for upsert operations.",
|
|
200
|
+
"hasDynamicHelp": false,
|
|
201
|
+
"multiple": false,
|
|
202
|
+
"type": "option"
|
|
203
|
+
},
|
|
204
|
+
"database": {
|
|
205
|
+
"char": "d",
|
|
206
|
+
"exclusive": [
|
|
207
|
+
"config-file"
|
|
208
|
+
],
|
|
209
|
+
"name": "database",
|
|
210
|
+
"summary": "Path to the SQLite database file.",
|
|
211
|
+
"default": "bulkyard.db",
|
|
212
|
+
"hasDynamicHelp": false,
|
|
213
|
+
"multiple": false,
|
|
214
|
+
"type": "option"
|
|
215
|
+
},
|
|
216
|
+
"table": {
|
|
217
|
+
"char": "t",
|
|
218
|
+
"dependsOn": [
|
|
219
|
+
"sobject"
|
|
220
|
+
],
|
|
221
|
+
"name": "table",
|
|
222
|
+
"summary": "SQLite table name override (defaults to the object name).",
|
|
223
|
+
"hasDynamicHelp": false,
|
|
224
|
+
"multiple": false,
|
|
225
|
+
"type": "option"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"hasDynamicHelp": true,
|
|
229
|
+
"hiddenAliases": [],
|
|
230
|
+
"id": "bulkyard:load",
|
|
231
|
+
"pluginAlias": "bulkyard",
|
|
232
|
+
"pluginName": "bulkyard",
|
|
233
|
+
"pluginType": "core",
|
|
234
|
+
"strict": true,
|
|
235
|
+
"summary": "Load data from a local SQLite database into a Salesforce org using Bulk API 2.0.",
|
|
236
|
+
"enableJsonFlag": true,
|
|
237
|
+
"isESM": true,
|
|
238
|
+
"relativePath": [
|
|
239
|
+
"lib",
|
|
240
|
+
"commands",
|
|
241
|
+
"bulkyard",
|
|
242
|
+
"load.js"
|
|
243
|
+
],
|
|
244
|
+
"aliasPermutations": [],
|
|
245
|
+
"permutations": [
|
|
246
|
+
"bulkyard:load",
|
|
247
|
+
"load:bulkyard"
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"version": "1.0.0"
|
|
252
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bulkyard",
|
|
3
|
+
"description": "A Salesforce CLI plugin for bulk data extraction and loading via local SQLite3 databases.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@oclif/core": "^4",
|
|
7
|
+
"@salesforce/core": "^8",
|
|
8
|
+
"@salesforce/sf-plugins-core": "^12",
|
|
9
|
+
"better-sqlite3": "^9",
|
|
10
|
+
"js-yaml": "^4.1.1"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@oclif/plugin-command-snapshot": "^5.1.9",
|
|
14
|
+
"@salesforce/cli-plugins-testkit": "^5.3.10",
|
|
15
|
+
"@salesforce/dev-scripts": "^10",
|
|
16
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
17
|
+
"@types/js-yaml": "^4.0.9",
|
|
18
|
+
"eslint-plugin-sf-plugin": "^1.18.6",
|
|
19
|
+
"oclif": "^4.14.0",
|
|
20
|
+
"ts-node": "^10.9.2",
|
|
21
|
+
"typescript": "^5.4.5"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"/lib",
|
|
28
|
+
"/messages",
|
|
29
|
+
"/oclif.manifest.json",
|
|
30
|
+
"/oclif.lock"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"force",
|
|
34
|
+
"salesforce",
|
|
35
|
+
"salesforcedx",
|
|
36
|
+
"sf",
|
|
37
|
+
"sf-plugin",
|
|
38
|
+
"sfdx",
|
|
39
|
+
"sfdx-plugin"
|
|
40
|
+
],
|
|
41
|
+
"license": "BSD-3-Clause",
|
|
42
|
+
"oclif": {
|
|
43
|
+
"commands": "./lib/commands",
|
|
44
|
+
"bin": "sf",
|
|
45
|
+
"topicSeparator": " ",
|
|
46
|
+
"devPlugins": [
|
|
47
|
+
"@oclif/plugin-help"
|
|
48
|
+
],
|
|
49
|
+
"topics": {
|
|
50
|
+
"bulkyard": {
|
|
51
|
+
"description": "Extract and load Salesforce data via local SQLite databases."
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"flexibleTaxonomy": true
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "wireit",
|
|
58
|
+
"clean": "sf-clean",
|
|
59
|
+
"clean-all": "sf-clean all",
|
|
60
|
+
"compile": "wireit",
|
|
61
|
+
"docs": "sf-docs",
|
|
62
|
+
"format": "wireit",
|
|
63
|
+
"link-check": "wireit",
|
|
64
|
+
"lint": "wireit",
|
|
65
|
+
"postinstall": "yarn husky install",
|
|
66
|
+
"postpack": "sf-clean --ignore-signing-artifacts",
|
|
67
|
+
"prepack": "sf-prepack",
|
|
68
|
+
"test": "wireit",
|
|
69
|
+
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
70
|
+
"test:only": "wireit",
|
|
71
|
+
"version": "oclif readme"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public"
|
|
75
|
+
},
|
|
76
|
+
"wireit": {
|
|
77
|
+
"build": {
|
|
78
|
+
"dependencies": [
|
|
79
|
+
"compile",
|
|
80
|
+
"lint"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"compile": {
|
|
84
|
+
"command": "tsc -p . --pretty --incremental",
|
|
85
|
+
"files": [
|
|
86
|
+
"src/**/*.ts",
|
|
87
|
+
"**/tsconfig.json",
|
|
88
|
+
"messages/**"
|
|
89
|
+
],
|
|
90
|
+
"output": [
|
|
91
|
+
"lib/**",
|
|
92
|
+
"*.tsbuildinfo"
|
|
93
|
+
],
|
|
94
|
+
"clean": "if-file-deleted"
|
|
95
|
+
},
|
|
96
|
+
"format": {
|
|
97
|
+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
|
|
98
|
+
"files": [
|
|
99
|
+
"src/**/*.ts",
|
|
100
|
+
"test/**/*.ts",
|
|
101
|
+
"schemas/**/*.json",
|
|
102
|
+
"command-snapshot.json",
|
|
103
|
+
".prettier*"
|
|
104
|
+
],
|
|
105
|
+
"output": []
|
|
106
|
+
},
|
|
107
|
+
"lint": {
|
|
108
|
+
"command": "eslint src test --color --cache --cache-location .eslintcache",
|
|
109
|
+
"files": [
|
|
110
|
+
"src/**/*.ts",
|
|
111
|
+
"test/**/*.ts",
|
|
112
|
+
"messages/**",
|
|
113
|
+
"**/.eslint*",
|
|
114
|
+
"**/tsconfig.json"
|
|
115
|
+
],
|
|
116
|
+
"output": []
|
|
117
|
+
},
|
|
118
|
+
"test:compile": {
|
|
119
|
+
"command": "tsc -p \"./test\" --pretty",
|
|
120
|
+
"files": [
|
|
121
|
+
"test/**/*.ts",
|
|
122
|
+
"**/tsconfig.json"
|
|
123
|
+
],
|
|
124
|
+
"output": []
|
|
125
|
+
},
|
|
126
|
+
"test": {
|
|
127
|
+
"dependencies": [
|
|
128
|
+
"test:compile",
|
|
129
|
+
"test:only",
|
|
130
|
+
"lint"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"test:only": {
|
|
134
|
+
"command": "nyc mocha \"test/**/*.test.ts\"",
|
|
135
|
+
"env": {
|
|
136
|
+
"FORCE_COLOR": "2"
|
|
137
|
+
},
|
|
138
|
+
"files": [
|
|
139
|
+
"test/**/*.ts",
|
|
140
|
+
"src/**/*.ts",
|
|
141
|
+
"**/tsconfig.json",
|
|
142
|
+
".mocha*",
|
|
143
|
+
"!*.nut.ts",
|
|
144
|
+
".nycrc"
|
|
145
|
+
],
|
|
146
|
+
"output": []
|
|
147
|
+
},
|
|
148
|
+
"test:command-reference": {
|
|
149
|
+
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" commandreference:generate --erroronwarnings",
|
|
150
|
+
"files": [
|
|
151
|
+
"src/**/*.ts",
|
|
152
|
+
"messages/**",
|
|
153
|
+
"package.json"
|
|
154
|
+
],
|
|
155
|
+
"output": [
|
|
156
|
+
"tmp/root"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"test:deprecation-policy": {
|
|
160
|
+
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:compare",
|
|
161
|
+
"files": [
|
|
162
|
+
"src/**/*.ts"
|
|
163
|
+
],
|
|
164
|
+
"output": [],
|
|
165
|
+
"dependencies": [
|
|
166
|
+
"compile"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"test:json-schema": {
|
|
170
|
+
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" schema:compare",
|
|
171
|
+
"files": [
|
|
172
|
+
"src/**/*.ts",
|
|
173
|
+
"schemas"
|
|
174
|
+
],
|
|
175
|
+
"output": []
|
|
176
|
+
},
|
|
177
|
+
"link-check": {
|
|
178
|
+
"command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error",
|
|
179
|
+
"files": [
|
|
180
|
+
"./*.md",
|
|
181
|
+
"./!(CHANGELOG).md",
|
|
182
|
+
"messages/**/*.md"
|
|
183
|
+
],
|
|
184
|
+
"output": []
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"exports": "./lib/index.js",
|
|
188
|
+
"type": "module",
|
|
189
|
+
"author": "Jesse Wheeler",
|
|
190
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
191
|
+
}
|