Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sprucelabs/babel-plugin-schema

Package Overview
Dependencies
Maintainers
3
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sprucelabs/babel-plugin-schema - npm Package Compare versions

Comparing version 3.0.15 to 3.1.0

5

build/__tests__/behavioral/SchemaBuildsAndMapsPaths.test.d.ts

@@ -7,3 +7,2 @@ import AbstractSpruceTest from '@sprucelabs/test';

protected static afterEach(): Promise<void>;
protected static buildsSchemaWithoutErrorWithoutLocalHashSpruce(useCommandLine?: boolean): Promise<void>;
private static copyAndResolvePaths;

@@ -14,6 +13,2 @@ private static resolvePathAliasesUsingCommandLine;

}) | undefined, expectedFileMatch: string): Promise<void>;
private static fieldFactoryFilepath;
protected static buildsSchemaAndUsesTheLocalHashSpruceVersionOfFiles(useCommandLine?: boolean): Promise<void>;
protected static testBuildingFullSkillWithBabel(): Promise<void>;
private static copyDir;
private static setupNewPackage;

@@ -20,0 +15,0 @@ private static setupNewCwd;

77

build/__tests__/behavioral/SchemaBuildsAndMapsPaths.test.js

@@ -65,13 +65,2 @@ "use strict";

}
static async buildsSchemaWithoutErrorWithoutLocalHashSpruce(useCommandLine) {
const cwd = await this.setupNewPackage();
const fieldFactoryFile = this.fieldFactoryFilepath(cwd);
const contents = fs_extra_1.default.readFileSync(fieldFactoryFile).toString();
test_1.assert.doesInclude(contents, '#spruce');
await this.copyAndResolvePaths(cwd, { useCommandLine });
const afterMapContents = fs_extra_1.default.readFileSync(fieldFactoryFile).toString();
test_1.assert.doesNotInclude(afterMapContents, cwd);
test_1.assert.doesNotInclude(afterMapContents, '#spruce');
test_1.assert.doesInclude(afterMapContents, './../.spruce/schemas/fields/fieldClassMap');
}
static async copyAndResolvePaths(cwd, options = {}) {

@@ -125,57 +114,2 @@ const { useCommandLine = false } = options, resolveOptions = __rest(options, ["useCommandLine"]);

}
static fieldFactoryFilepath(cwd) {
return this.resolvePath(cwd, 'node_modules/@sprucelabs/schema', 'build/factories/FieldFactory.js');
}
static async buildsSchemaAndUsesTheLocalHashSpruceVersionOfFiles(useCommandLine) {
const cwd = await this.setupNewPackage();
// copy schema files
const sourceHashSpruce = this.resolvePath(cwd, 'node_modules', '@sprucelabs/schema', 'build', '.spruce');
const destinationHashSpruce = this.resolvePath(cwd, 'src', '.spruce');
await this.copyDir(sourceHashSpruce, destinationHashSpruce);
// copy schema.types example
const sourceSchemaTypes = this.resolvePath('src', '__tests__', 'files');
const schemaTypesDestination = this.resolvePath(destinationHashSpruce, 'schemas');
await this.copyDir(sourceSchemaTypes, schemaTypesDestination);
await this.copyAndResolvePaths(cwd, {
useCommandLine,
patterns: ['**/*.js', '**/*.d.ts'],
});
const fieldFactoryFile = this.fieldFactoryFilepath(cwd);
const afterMapContents = fs_extra_1.default.readFileSync(fieldFactoryFile).toString();
test_1.assert.doesNotInclude(afterMapContents, '#spruce');
test_1.assert.doesInclude(afterMapContents, './../../../../../build/.spruce/schemas/fields/fieldClassMap');
const schemaTypesFile = this.resolvePath(schemaTypesDestination, 'schemas.types.d.ts');
const schemaTypesContent = fs_extra_1.default.readFileSync(schemaTypesFile).toString();
test_1.assert.doesNotInclude(schemaTypesContent, '#spruce');
test_1.assert.doesInclude(schemaTypesContent, './../../../build/.spruce/schemas/fields/fieldTypeEnum');
}
static async testBuildingFullSkillWithBabel() {
const cwd = await this.setupNewCwd();
const sourceDir = this.resolvePath('src', '__tests__', 'empty_skill');
await this.copyDir(sourceDir, cwd);
const buildIndex = this.resolvePath('build', 'index.js');
const babelFile = this.resolvePath(cwd, 'babel.config.js');
let babelContents = fs_extra_1.default
.readFileSync(babelFile)
.toString()
.replace('{{schema-plugin}}', buildIndex);
fs_extra_1.default.writeFileSync(babelFile, babelContents);
await this.executeCommand(cwd, 'yarn');
await this.executeCommand(cwd, 'yarn build');
const checkFile = this.fieldFactoryFilepath(cwd);
const checkFileContents = fs_extra_1.default.readFileSync(checkFile).toString();
test_1.assert.doesNotInclude(checkFileContents, 'src/.spruce');
test_1.assert.doesInclude(checkFileContents, './../../../../../build/.spruce/schemas/fields/fieldClassMap');
}
static async copyDir(source, destination) {
await fs_extra_1.default.ensureDir(destination);
return new Promise((resolve) => {
child_process_1.exec(`cd ${source} && tar cf - . | (cd ${destination}; tar xf -)`, { maxBuffer: 1024 * 1024 * 5 }, (err, stdout) => {
if (err) {
throw err;
}
resolve(stdout);
});
});
}
static async setupNewPackage() {

@@ -221,6 +155,2 @@ const cwd = await this.setupNewCwd();

__decorate([
test_1.test('builds and resolves without local hash spruce (direct command)'),
test_1.test('builds and resolves without local hash spruce (command line)', true)
], SchemaBuildsAndMapsPathsTest, "buildsSchemaWithoutErrorWithoutLocalHashSpruce", null);
__decorate([
test_1.test('resolve paths relatively', 'test-import.d.ts', {

@@ -243,10 +173,3 @@ patterns: ['**/*.d.ts'],

], SchemaBuildsAndMapsPathsTest, "testVariousMatches", null);
__decorate([
test_1.test('build schema and use local hash spruce version of files', false),
test_1.test('build schema and use local hash spruce version of files (command line)', true)
], SchemaBuildsAndMapsPathsTest, "buildsSchemaAndUsesTheLocalHashSpruceVersionOfFiles", null);
__decorate([
test_1.test()
], SchemaBuildsAndMapsPathsTest, "testBuildingFullSkillWithBabel", null);
exports.default = SchemaBuildsAndMapsPathsTest;
//# sourceMappingURL=SchemaBuildsAndMapsPaths.test.js.map

1098

build/__tests__/files/schemas.types.d.ts
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-redeclare */
//@ts-ignore
import { default as SchemaEntity } from '@sprucelabs/schema'
import { default as SchemaEntity } from "@sprucelabs/schema";
//@ts-ignore
import * as SpruceSchema from '@sprucelabs/schema'
//@ts-ignore
import FieldType from '#spruce/schemas/fields/fieldTypeEnum'
import * as SpruceSchema from "@sprucelabs/schema";

@@ -13,15 +11,15 @@ export declare namespace SpruceSchemas.Spruce.v2020_07_22 {

/** Permissions grouped by slug. */
[slug: string]: string[] | undefined | null
[slug: string]: string[] | undefined | null;
}
export interface IAclSchema extends SpruceSchema.ISchema {
id: 'acl'
name: 'Access control list'
id: "acl";
name: "Access control list";
dynamicFieldSignature: {
label: 'Permissions grouped by slug'
type: FieldType.Text
keyName: 'slug'
isArray: true
options: undefined
}
label: "Permissions grouped by slug";
type: "text";
keyName: "slug";
isArray: true;
options: undefined;
};
}

@@ -31,3 +29,3 @@

SpruceSchemas.Spruce.v2020_07_22.IAclSchema
>
>;
}

@@ -39,292 +37,292 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Name. */
name: string
name: string;
/** Store number. You can use other symbols, like # or dashes. #123 or 32-US-5 */
num?: string | undefined | null
num?: string | undefined | null;
/** Public. Is this location viewable by guests? */
isPublic?: boolean | undefined | null
isPublic?: boolean | undefined | null;
/** Main Phone. */
phone?: string | undefined | null
phone?: string | undefined | null;
/** Timezone. */
timezone?:
| (
| 'etc/gmt+12'
| 'pacific/midway'
| 'pacific/honolulu'
| 'us/alaska'
| 'america/los_Angeles'
| 'america/tijuana'
| 'us/arizona'
| 'america/chihuahua'
| 'us/mountain'
| 'america/managua'
| 'us/central'
| 'america/mexico_City'
| 'Canada/Saskatchewan'
| 'america/bogota'
| 'us/eastern'
| 'us/east-indiana'
| 'Canada/atlantic'
| 'america/caracas'
| 'america/manaus'
| 'america/Santiago'
| 'Canada/Newfoundland'
| 'america/Sao_Paulo'
| 'america/argentina/buenos_Aires'
| 'america/godthab'
| 'america/montevideo'
| 'america/Noronha'
| 'atlantic/cape_Verde'
| 'atlantic/azores'
| 'africa/casablanca'
| 'etc/gmt'
| 'europe/amsterdam'
| 'europe/belgrade'
| 'europe/brussels'
| 'europe/Sarajevo'
| 'africa/lagos'
| 'asia/amman'
| 'europe/athens'
| 'asia/beirut'
| 'africa/cairo'
| 'africa/Harare'
| 'europe/Helsinki'
| 'asia/Jerusalem'
| 'europe/minsk'
| 'africa/Windhoek'
| 'asia/Kuwait'
| 'europe/moscow'
| 'africa/Nairobi'
| 'asia/tbilisi'
| 'asia/tehran'
| 'asia/muscat'
| 'asia/baku'
| 'asia/Yerevan'
| 'asia/Kabul'
| 'asia/Yekaterinburg'
| 'asia/Karachi'
| 'asia/calcutta'
| 'asia/calcutta'
| 'asia/Katmandu'
| 'asia/almaty'
| 'asia/Dhaka'
| 'asia/Rangoon'
| 'asia/bangkok'
| 'asia/Krasnoyarsk'
| 'asia/Hong_Kong'
| 'asia/Kuala_Lumpur'
| 'asia/Irkutsk'
| 'Australia/Perth'
| 'asia/taipei'
| 'asia/tokyo'
| 'asia/Seoul'
| 'asia/Yakutsk'
| 'Australia/adelaide'
| 'Australia/Darwin'
| 'Australia/brisbane'
| 'Australia/canberra'
| 'Australia/Hobart'
| 'pacific/guam'
| 'asia/Vladivostok'
| 'asia/magadan'
| 'pacific/auckland'
| 'pacific/Fiji'
| 'pacific/tongatapu'
)
| undefined
| null
| (
| "etc/gmt+12"
| "pacific/midway"
| "pacific/honolulu"
| "us/alaska"
| "america/los_Angeles"
| "america/tijuana"
| "us/arizona"
| "america/chihuahua"
| "us/mountain"
| "america/managua"
| "us/central"
| "america/mexico_City"
| "Canada/Saskatchewan"
| "america/bogota"
| "us/eastern"
| "us/east-indiana"
| "Canada/atlantic"
| "america/caracas"
| "america/manaus"
| "america/Santiago"
| "Canada/Newfoundland"
| "america/Sao_Paulo"
| "america/argentina/buenos_Aires"
| "america/godthab"
| "america/montevideo"
| "america/Noronha"
| "atlantic/cape_Verde"
| "atlantic/azores"
| "africa/casablanca"
| "etc/gmt"
| "europe/amsterdam"
| "europe/belgrade"
| "europe/brussels"
| "europe/Sarajevo"
| "africa/lagos"
| "asia/amman"
| "europe/athens"
| "asia/beirut"
| "africa/cairo"
| "africa/Harare"
| "europe/Helsinki"
| "asia/Jerusalem"
| "europe/minsk"
| "africa/Windhoek"
| "asia/Kuwait"
| "europe/moscow"
| "africa/Nairobi"
| "asia/tbilisi"
| "asia/tehran"
| "asia/muscat"
| "asia/baku"
| "asia/Yerevan"
| "asia/Kabul"
| "asia/Yekaterinburg"
| "asia/Karachi"
| "asia/calcutta"
| "asia/calcutta"
| "asia/Katmandu"
| "asia/almaty"
| "asia/Dhaka"
| "asia/Rangoon"
| "asia/bangkok"
| "asia/Krasnoyarsk"
| "asia/Hong_Kong"
| "asia/Kuala_Lumpur"
| "asia/Irkutsk"
| "Australia/Perth"
| "asia/taipei"
| "asia/tokyo"
| "asia/Seoul"
| "asia/Yakutsk"
| "Australia/adelaide"
| "Australia/Darwin"
| "Australia/brisbane"
| "Australia/canberra"
| "Australia/Hobart"
| "pacific/guam"
| "asia/Vladivostok"
| "asia/magadan"
| "pacific/auckland"
| "pacific/Fiji"
| "pacific/tongatapu"
)
| undefined
| null;
/** Address. */
address: SpruceSchema.IAddressFieldValue
address: SpruceSchema.IAddressFieldValue;
}
export interface ILocationSchema extends SpruceSchema.ISchema {
id: 'location'
name: 'Location'
description: 'A physical location where people meet. An organization has at least one of them.'
id: "location";
name: "Location";
description: "A physical location where people meet. An organization has at least one of them.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Store number. You can use other symbols, like # or dashes. #123 or 32-US-5 */
num: {
label: 'Store number'
type: FieldType.Text
hint: 'You can use other symbols, like # or dashes. #123 or 32-US-5'
options: undefined
}
label: "Store number";
type: "text";
hint: "You can use other symbols, like # or dashes. #123 or 32-US-5";
options: undefined;
};
/** Public. Is this location viewable by guests? */
isPublic: {
label: 'Public'
type: FieldType.Boolean
hint: 'Is this location viewable by guests?'
defaultValue: false
options: undefined
}
label: "Public";
type: "boolean";
hint: "Is this location viewable by guests?";
defaultValue: false;
options: undefined;
};
/** Main Phone. */
phone: {
label: 'Main Phone'
type: FieldType.Phone
options: undefined
}
label: "Main Phone";
type: "phone";
options: undefined;
};
/** Timezone. */
timezone: {
label: 'Timezone'
type: FieldType.Select
label: "Timezone";
type: "select";
options: {
choices: [
{ value: 'etc/gmt+12'; label: 'International Date Line West' },
{ value: 'pacific/midway'; label: 'Midway Island, Samoa' },
{ value: 'pacific/honolulu'; label: 'Hawaii' },
{ value: 'us/alaska'; label: 'Alaska' },
{ value: "etc/gmt+12"; label: "International Date Line West" },
{ value: "pacific/midway"; label: "Midway Island, Samoa" },
{ value: "pacific/honolulu"; label: "Hawaii" },
{ value: "us/alaska"; label: "Alaska" },
{
value: 'america/los_Angeles'
label: 'Pacific Time (US & Canada)'
value: "america/los_Angeles";
label: "Pacific Time (US & Canada)";
},
{ value: 'america/tijuana'; label: 'Tijuana, Baja California' },
{ value: 'us/arizona'; label: 'Arizona' },
{ value: "america/tijuana"; label: "Tijuana, Baja California" },
{ value: "us/arizona"; label: "Arizona" },
{
value: 'america/chihuahua'
label: 'Chihuahua, La Paz, Mazatlan'
value: "america/chihuahua";
label: "Chihuahua, La Paz, Mazatlan";
},
{ value: 'us/mountain'; label: 'Mountain Time (US & Canada)' },
{ value: 'america/managua'; label: 'Central America' },
{ value: 'us/central'; label: 'Central Time (US & Canada)' },
{ value: "us/mountain"; label: "Mountain Time (US & Canada)" },
{ value: "america/managua"; label: "Central America" },
{ value: "us/central"; label: "Central Time (US & Canada)" },
{
value: 'america/mexico_City'
label: 'Guadalajara, Mexico City, Monterrey'
value: "america/mexico_City";
label: "Guadalajara, Mexico City, Monterrey";
},
{ value: 'Canada/Saskatchewan'; label: 'Saskatchewan' },
{ value: "Canada/Saskatchewan"; label: "Saskatchewan" },
{
value: 'america/bogota'
label: 'Bogota, Lima, Quito, Rio Branco'
value: "america/bogota";
label: "Bogota, Lima, Quito, Rio Branco";
},
{ value: 'us/eastern'; label: 'Eastern Time (US & Canada)' },
{ value: 'us/east-indiana'; label: 'Indiana (East)' },
{ value: 'Canada/atlantic'; label: 'Atlantic Time (Canada)' },
{ value: 'america/caracas'; label: 'Caracas, La Paz' },
{ value: 'america/manaus'; label: 'Manaus' },
{ value: 'america/Santiago'; label: 'Santiago' },
{ value: 'Canada/Newfoundland'; label: 'Newfoundland' },
{ value: 'america/Sao_Paulo'; label: 'Brasilia' },
{ value: "us/eastern"; label: "Eastern Time (US & Canada)" },
{ value: "us/east-indiana"; label: "Indiana (East)" },
{ value: "Canada/atlantic"; label: "Atlantic Time (Canada)" },
{ value: "america/caracas"; label: "Caracas, La Paz" },
{ value: "america/manaus"; label: "Manaus" },
{ value: "america/Santiago"; label: "Santiago" },
{ value: "Canada/Newfoundland"; label: "Newfoundland" },
{ value: "america/Sao_Paulo"; label: "Brasilia" },
{
value: 'america/argentina/buenos_Aires'
label: 'Buenos Aires, Georgetown'
value: "america/argentina/buenos_Aires";
label: "Buenos Aires, Georgetown";
},
{ value: 'america/godthab'; label: 'Greenland' },
{ value: 'america/montevideo'; label: 'Montevideo' },
{ value: 'america/Noronha'; label: 'Mid-Atlantic' },
{ value: 'atlantic/cape_Verde'; label: 'Cape Verde Is.' },
{ value: 'atlantic/azores'; label: 'Azores' },
{ value: "america/godthab"; label: "Greenland" },
{ value: "america/montevideo"; label: "Montevideo" },
{ value: "america/Noronha"; label: "Mid-Atlantic" },
{ value: "atlantic/cape_Verde"; label: "Cape Verde Is." },
{ value: "atlantic/azores"; label: "Azores" },
{
value: 'africa/casablanca'
label: 'Casablanca, Monrovia, Reykjavik'
value: "africa/casablanca";
label: "Casablanca, Monrovia, Reykjavik";
},
{
value: 'etc/gmt'
label: 'Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London'
value: "etc/gmt";
label: "Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London";
},
{
value: 'europe/amsterdam'
label: 'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'
value: "europe/amsterdam";
label: "Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna";
},
{
value: 'europe/belgrade'
label: 'Belgrade, Bratislava, Budapest, Ljubljana, Prague'
value: "europe/belgrade";
label: "Belgrade, Bratislava, Budapest, Ljubljana, Prague";
},
{
value: 'europe/brussels'
label: 'Brussels, Copenhagen, Madrid, Paris'
value: "europe/brussels";
label: "Brussels, Copenhagen, Madrid, Paris";
},
{
value: 'europe/Sarajevo'
label: 'Sarajevo, Skopje, Warsaw, Zagreb'
value: "europe/Sarajevo";
label: "Sarajevo, Skopje, Warsaw, Zagreb";
},
{ value: 'africa/lagos'; label: 'West Central Africa' },
{ value: 'asia/amman'; label: 'Amman' },
{ value: 'europe/athens'; label: 'Athens, Bucharest, Istanbul' },
{ value: 'asia/beirut'; label: 'Beirut' },
{ value: 'africa/cairo'; label: 'Cairo' },
{ value: 'africa/Harare'; label: 'Harare, Pretoria' },
{ value: "africa/lagos"; label: "West Central Africa" },
{ value: "asia/amman"; label: "Amman" },
{ value: "europe/athens"; label: "Athens, Bucharest, Istanbul" },
{ value: "asia/beirut"; label: "Beirut" },
{ value: "africa/cairo"; label: "Cairo" },
{ value: "africa/Harare"; label: "Harare, Pretoria" },
{
value: 'europe/Helsinki'
label: 'Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius'
value: "europe/Helsinki";
label: "Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius";
},
{ value: 'asia/Jerusalem'; label: 'Jerusalem' },
{ value: 'europe/minsk'; label: 'Minsk' },
{ value: 'africa/Windhoek'; label: 'Windhoek' },
{ value: 'asia/Kuwait'; label: 'Kuwait, Riyadh, Baghdad' },
{ value: "asia/Jerusalem"; label: "Jerusalem" },
{ value: "europe/minsk"; label: "Minsk" },
{ value: "africa/Windhoek"; label: "Windhoek" },
{ value: "asia/Kuwait"; label: "Kuwait, Riyadh, Baghdad" },
{
value: 'europe/moscow'
label: 'Moscow, St. Petersburg, Volgograd'
value: "europe/moscow";
label: "Moscow, St. Petersburg, Volgograd";
},
{ value: 'africa/Nairobi'; label: 'Nairobi' },
{ value: 'asia/tbilisi'; label: 'Tbilisi' },
{ value: 'asia/tehran'; label: 'Tehran' },
{ value: 'asia/muscat'; label: 'Abu Dhabi, Muscat' },
{ value: 'asia/baku'; label: 'Baku' },
{ value: 'asia/Yerevan'; label: 'Yerevan' },
{ value: 'asia/Kabul'; label: 'Kabul' },
{ value: 'asia/Yekaterinburg'; label: 'Yekaterinburg' },
{ value: 'asia/Karachi'; label: 'Islamabad, Karachi, Tashkent' },
{ value: "africa/Nairobi"; label: "Nairobi" },
{ value: "asia/tbilisi"; label: "Tbilisi" },
{ value: "asia/tehran"; label: "Tehran" },
{ value: "asia/muscat"; label: "Abu Dhabi, Muscat" },
{ value: "asia/baku"; label: "Baku" },
{ value: "asia/Yerevan"; label: "Yerevan" },
{ value: "asia/Kabul"; label: "Kabul" },
{ value: "asia/Yekaterinburg"; label: "Yekaterinburg" },
{ value: "asia/Karachi"; label: "Islamabad, Karachi, Tashkent" },
{
value: 'asia/calcutta'
label: 'Chennai, Kolkata, Mumbai, New Delhi'
value: "asia/calcutta";
label: "Chennai, Kolkata, Mumbai, New Delhi";
},
{ value: 'asia/calcutta'; label: 'Sri Jayawardenapura' },
{ value: 'asia/Katmandu'; label: 'Kathmandu' },
{ value: 'asia/almaty'; label: 'Almaty, Novosibirsk' },
{ value: 'asia/Dhaka'; label: 'Astana, Dhaka' },
{ value: 'asia/Rangoon'; label: 'Yangon (Rangoon)' },
{ value: 'asia/bangkok'; label: 'Bangkok, Hanoi, Jakarta' },
{ value: 'asia/Krasnoyarsk'; label: 'Krasnoyarsk' },
{ value: "asia/calcutta"; label: "Sri Jayawardenapura" },
{ value: "asia/Katmandu"; label: "Kathmandu" },
{ value: "asia/almaty"; label: "Almaty, Novosibirsk" },
{ value: "asia/Dhaka"; label: "Astana, Dhaka" },
{ value: "asia/Rangoon"; label: "Yangon (Rangoon)" },
{ value: "asia/bangkok"; label: "Bangkok, Hanoi, Jakarta" },
{ value: "asia/Krasnoyarsk"; label: "Krasnoyarsk" },
{
value: 'asia/Hong_Kong'
label: 'Beijing, Chongqing, Hong Kong, Urumqi'
value: "asia/Hong_Kong";
label: "Beijing, Chongqing, Hong Kong, Urumqi";
},
{ value: 'asia/Kuala_Lumpur'; label: 'Kuala Lumpur, Singapore' },
{ value: 'asia/Irkutsk'; label: 'Irkutsk, Ulaan Bataar' },
{ value: 'Australia/Perth'; label: 'Perth' },
{ value: 'asia/taipei'; label: 'Taipei' },
{ value: 'asia/tokyo'; label: 'Osaka, Sapporo, Tokyo' },
{ value: 'asia/Seoul'; label: 'Seoul' },
{ value: 'asia/Yakutsk'; label: 'Yakutsk' },
{ value: 'Australia/adelaide'; label: 'Adelaide' },
{ value: 'Australia/Darwin'; label: 'Darwin' },
{ value: 'Australia/brisbane'; label: 'Brisbane' },
{ value: "asia/Kuala_Lumpur"; label: "Kuala Lumpur, Singapore" },
{ value: "asia/Irkutsk"; label: "Irkutsk, Ulaan Bataar" },
{ value: "Australia/Perth"; label: "Perth" },
{ value: "asia/taipei"; label: "Taipei" },
{ value: "asia/tokyo"; label: "Osaka, Sapporo, Tokyo" },
{ value: "asia/Seoul"; label: "Seoul" },
{ value: "asia/Yakutsk"; label: "Yakutsk" },
{ value: "Australia/adelaide"; label: "Adelaide" },
{ value: "Australia/Darwin"; label: "Darwin" },
{ value: "Australia/brisbane"; label: "Brisbane" },
{
value: 'Australia/canberra'
label: 'Canberra, Melbourne, Sydney'
value: "Australia/canberra";
label: "Canberra, Melbourne, Sydney";
},
{ value: 'Australia/Hobart'; label: 'Hobart' },
{ value: 'pacific/guam'; label: 'Guam, Port Moresby' },
{ value: 'asia/Vladivostok'; label: 'Vladivostok' },
{ value: "Australia/Hobart"; label: "Hobart" },
{ value: "pacific/guam"; label: "Guam, Port Moresby" },
{ value: "asia/Vladivostok"; label: "Vladivostok" },
{
value: 'asia/magadan'
label: 'Magadan, Solomon Is., New Caledonia'
value: "asia/magadan";
label: "Magadan, Solomon Is., New Caledonia";
},
{ value: 'pacific/auckland'; label: 'Auckland, Wellington' },
{ value: 'pacific/Fiji'; label: 'Fiji, Kamchatka, Marshall Is.' },
{ value: 'pacific/tongatapu'; label: "Nuku'alofa" }
]
}
}
{ value: "pacific/auckland"; label: "Auckland, Wellington" },
{ value: "pacific/Fiji"; label: "Fiji, Kamchatka, Marshall Is." },
{ value: "pacific/tongatapu"; label: "Nuku'alofa" }
];
};
};
/** Address. */
address: {
label: 'Address'
type: FieldType.Address
isRequired: true
options: undefined
}
}
label: "Address";
type: "address";
isRequired: true;
options: undefined;
};
};
}

@@ -334,3 +332,3 @@

SpruceSchemas.Spruce.v2020_07_22.ILocationSchema
>
>;
}

@@ -342,69 +340,69 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Is default. Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest). */
isDefault: string
isDefault: string;
/** Name. */
name: string
name: string;
/** Role. */
role: 'owner' | 'groupManager' | 'manager' | 'teammate' | 'guest'
role: "owner" | "groupManager" | "manager" | "teammate" | "guest";
/** On work permissions. */
inStoreAcls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null
inStoreAcls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null;
/** Off work permissions. */
acls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null
acls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null;
}
export interface IJobSchema extends SpruceSchema.ISchema {
id: 'job'
name: 'Job'
description: 'A position at a company. The answer to the question; What is your job?'
id: "job";
name: "Job";
description: "A position at a company. The answer to the question; What is your job?";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Is default. Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest). */
isDefault: {
label: 'Is default'
type: FieldType.Text
isRequired: true
hint: 'Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest).'
options: undefined
}
label: "Is default";
type: "text";
isRequired: true;
hint: "Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest).";
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Role. */
role: {
label: 'Role'
type: FieldType.Select
isRequired: true
label: "Role";
type: "select";
isRequired: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** On work permissions. */
inStoreAcls: {
label: 'On work permissions'
type: FieldType.Schema
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema }
}
label: "On work permissions";
type: 'schema',
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema };
};
/** Off work permissions. */
acls: {
label: 'Off work permissions'
type: FieldType.Schema
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema }
}
}
label: "Off work permissions";
type: 'schema',
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema };
};
};
}

@@ -414,3 +412,3 @@

SpruceSchemas.Spruce.v2020_07_22.IJobSchema
>
>;
}

@@ -422,69 +420,69 @@

/** Id. */
id: string
id: string;
/** First name. */
firstName?: string | undefined | null
firstName?: string | undefined | null;
/** Last name. */
lastName?: string | undefined | null
lastName?: string | undefined | null;
/** Casual name. The name you can use when talking to this person. */
casualName: string
casualName: string;
/** Phone. A number that can be texted */
phone?: string | undefined | null
phone?: string | undefined | null;
/** Profile photos. */
profileImages?:
| SpruceSchemas.Spruce.v2020_07_22.IProfileImage
| undefined
| null
| SpruceSchemas.Spruce.v2020_07_22.IProfileImage
| undefined
| null;
}
export interface IPersonSchema extends SpruceSchema.ISchema {
id: 'person'
name: 'Person'
description: 'A human being.'
id: "person";
name: "Person";
description: "A human being.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isRequired: true;
options: undefined;
};
/** First name. */
firstName: {
label: 'First name'
type: FieldType.Text
isPrivate: true
options: undefined
}
label: "First name";
type: "text";
isPrivate: true;
options: undefined;
};
/** Last name. */
lastName: {
label: 'Last name'
type: FieldType.Text
isPrivate: true
options: undefined
}
label: "Last name";
type: "text";
isPrivate: true;
options: undefined;
};
/** Casual name. The name you can use when talking to this person. */
casualName: {
label: 'Casual name'
type: FieldType.Text
isRequired: true
hint: 'The name you can use when talking to this person.'
options: undefined
}
label: "Casual name";
type: "text";
isRequired: true;
hint: "The name you can use when talking to this person.";
options: undefined;
};
/** Phone. A number that can be texted */
phone: {
label: 'Phone'
type: FieldType.Phone
isPrivate: true
hint: 'A number that can be texted'
options: undefined
}
label: "Phone";
type: "phone";
isPrivate: true;
hint: "A number that can be texted";
options: undefined;
};
/** Profile photos. */
profileImages: {
label: 'Profile photos'
type: FieldType.Schema
label: "Profile photos";
type: 'schema',
options: {
schema: SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema
}
}
}
schema: SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema;
};
};
};
}

@@ -494,3 +492,3 @@

SpruceSchemas.Spruce.v2020_07_22.IPersonSchema
>
>;
}

@@ -502,95 +500,95 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Name. */
roles: 'owner' | 'groupManager' | 'manager' | 'teammate' | 'guest'
roles: "owner" | "groupManager" | "manager" | "teammate" | "guest";
/** Status. */
status?: string | undefined | null
status?: string | undefined | null;
/** Total visits. */
visits: number
visits: number;
/** Last visit. */
lastRecordedVisit?: SpruceSchema.IDateTimeFieldValue | undefined | null
lastRecordedVisit?: SpruceSchema.IDateTimeFieldValue | undefined | null;
/** Job. */
job: SpruceSchemas.Spruce.v2020_07_22.IJob
job: SpruceSchemas.Spruce.v2020_07_22.IJob;
/** Location. */
location: SpruceSchemas.Spruce.v2020_07_22.ILocation
location: SpruceSchemas.Spruce.v2020_07_22.ILocation;
/** Person. */
person: SpruceSchemas.Spruce.v2020_07_22.IPerson
person: SpruceSchemas.Spruce.v2020_07_22.IPerson;
}
export interface IPersonLocationSchema extends SpruceSchema.ISchema {
id: 'personLocation'
name: 'Person location'
description: "A person's visit to a location (business or home)."
id: "personLocation";
name: "Person location";
description: "A person's visit to a location (business or home).";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Name. */
roles: {
label: 'Name'
type: FieldType.Select
isRequired: true
isArray: true
label: "Name";
type: "select";
isRequired: true;
isArray: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** Status. */
status: {
label: 'Status'
type: FieldType.Text
options: undefined
}
label: "Status";
type: "text";
options: undefined;
};
/** Total visits. */
visits: {
label: 'Total visits'
type: FieldType.Number
isRequired: true
label: "Total visits";
type: 'number';
isRequired: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** Last visit. */
lastRecordedVisit: {
label: 'Last visit'
type: FieldType.DateTime
options: undefined
}
label: "Last visit";
type: 'dateTime',
options: undefined;
};
/** Job. */
job: {
label: 'Job'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IJobSchema }
}
label: "Job";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IJobSchema };
};
/** Location. */
location: {
label: 'Location'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.ILocationSchema }
}
label: "Location";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.ILocationSchema };
};
/** Person. */
person: {
label: 'Person'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IPersonSchema }
}
}
label: "Person";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IPersonSchema };
};
};
}

@@ -600,3 +598,3 @@

SpruceSchemas.Spruce.v2020_07_22.IPersonLocationSchema
>
>;
}

@@ -608,45 +606,45 @@

/** 60x60. */
profile60: string
profile60: string;
/** 150x150. */
profile150: string
profile150: string;
/** 60x60. */
'profile60@2x': string
"profile60@2x": string;
/** 150x150. */
'profile150@2x': string
"profile150@2x": string;
}
export interface IProfileImageSchema extends SpruceSchema.ISchema {
id: 'profileImage'
name: 'Profile Image Sizes'
description: 'Various sizes that a profile image comes in.'
id: "profileImage";
name: "Profile Image Sizes";
description: "Various sizes that a profile image comes in.";
fields: {
/** 60x60. */
profile60: {
label: '60x60'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "60x60";
type: "text";
isRequired: true;
options: undefined;
};
/** 150x150. */
profile150: {
label: '150x150'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "150x150";
type: "text";
isRequired: true;
options: undefined;
};
/** 60x60. */
'profile60@2x': {
label: '60x60'
type: FieldType.Text
isRequired: true
options: undefined
}
"profile60@2x": {
label: "60x60";
type: "text";
isRequired: true;
options: undefined;
};
/** 150x150. */
'profile150@2x': {
label: '150x150'
type: FieldType.Text
isRequired: true
options: undefined
}
}
"profile150@2x": {
label: "150x150";
type: "text";
isRequired: true;
options: undefined;
};
};
}

@@ -656,3 +654,3 @@

SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema
>
>;
}

@@ -662,22 +660,22 @@

export interface ISkillCreator {
skillId?: string | undefined | null
skillId?: string | undefined | null;
personId?: string | undefined | null
personId?: string | undefined | null;
}
export interface ISkillCreatorSchema extends SpruceSchema.ISchema {
id: 'skillCreator'
name: 'Skill creator'
id: "skillCreator";
name: "Skill creator";
fields: {
/** . */
skillId: {
type: FieldType.Text
options: undefined
}
type: "text";
options: undefined;
};
/** . */
personId: {
type: FieldType.Text
options: undefined
}
}
type: "text";
options: undefined;
};
};
}

@@ -687,3 +685,3 @@

SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema
>
>;
}

@@ -695,68 +693,68 @@

/** Id. */
id: string
id: string;
/** Id. */
apiKey: string
apiKey: string;
/** Name. */
name: string
name: string;
/** Description. */
description?: string | undefined | null
description?: string | undefined | null;
/** Slug. */
slug: string
slug: string;
/** Creators. The people or skills who created and own this skill. */
creators: SpruceSchemas.Spruce.v2020_07_22.ISkillCreator[]
creators: SpruceSchemas.Spruce.v2020_07_22.ISkillCreator[];
}
export interface ISkillSchema extends SpruceSchema.ISchema {
id: 'skill'
name: 'Skill'
description: 'An ability Sprucebot has learned.'
id: "skill";
name: "Skill";
description: "An ability Sprucebot has learned.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isRequired: true;
options: undefined;
};
/** Id. */
apiKey: {
label: 'Id'
type: FieldType.Id
isPrivate: true
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isPrivate: true;
isRequired: true;
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Description. */
description: {
label: 'Description'
type: FieldType.Text
options: undefined
}
label: "Description";
type: "text";
options: undefined;
};
/** Slug. */
slug: {
label: 'Slug'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Slug";
type: "text";
isRequired: true;
options: undefined;
};
/** Creators. The people or skills who created and own this skill. */
creators: {
label: 'Creators'
type: FieldType.Schema
isPrivate: true
isRequired: true
hint: 'The people or skills who created and own this skill.'
isArray: true
label: "Creators";
type: 'schema',
isPrivate: true;
isRequired: true;
hint: "The people or skills who created and own this skill.";
isArray: true;
options: {
schema: SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema
}
}
}
schema: SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema;
};
};
};
}

@@ -766,3 +764,3 @@

SpruceSchemas.Spruce.v2020_07_22.ISkillSchema
>
>;
}

@@ -772,46 +770,46 @@

export interface IEventSignature {
responsePayload?: SpruceSchema.ISchema | undefined | null
responsePayload?: SpruceSchema.ISchema | undefined | null;
emitPayload?: SpruceSchema.ISchema | undefined | null
emitPayload?: SpruceSchema.ISchema | undefined | null;
listenPermissionsAny?:
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null;
emitPermissionsAny?:
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null;
}
export interface IEventSignatureSchema extends SpruceSchema.ISchema {
id: 'eventSignature'
name: 'Event Signature'
id: "eventSignature";
name: "Event Signature";
fields: {
/** . */
responsePayload: {
type: FieldType.Raw
options: { valueType: `SpruceSchema.ISchema` }
}
type: 'raw';
options: { valueType: `SpruceSchema.ISchema` };
};
/** . */
emitPayload: {
type: FieldType.Raw
options: { valueType: `SpruceSchema.ISchema` }
}
type: 'raw';
options: { valueType: `SpruceSchema.ISchema` };
};
/** . */
listenPermissionsAny: {
type: FieldType.Schema
type: 'schema',
options: {
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
}
}
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema;
};
};
/** . */
emitPermissionsAny: {
type: FieldType.Schema
type: 'schema',
options: {
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
}
}
}
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema;
};
};
};
}

@@ -821,3 +819,3 @@

SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema
>
>;
}

@@ -829,15 +827,17 @@

[eventNameWithOptionalNamespace: string]:
| SpruceSchemas.Local.v2020_09_01.IEventSignature
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IEventSignature
| undefined
| null;
}
export interface IMercuryContractSchema extends SpruceSchema.ISchema {
id: 'mercuryContract'
name: 'Mercury Contract'
id: "mercuryContract";
name: "Mercury Contract";
dynamicFieldSignature: {
type: FieldType.Schema
keyName: 'eventNameWithOptionalNamespace'
options: { schema: SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema }
}
type: 'schema',
keyName: "eventNameWithOptionalNamespace";
options: {
schema: SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema;
};
};
}

@@ -847,3 +847,3 @@

SpruceSchemas.Local.v2020_09_01.IMercuryContractSchema
>
>;
}

@@ -854,44 +854,44 @@

/** Clocked in. Is the person clocked in and ready to rock? */
clockedIn?: boolean | undefined | null
clockedIn?: boolean | undefined | null;
/** Clocked out. When someone is not working (off the clock). */
clockedOut?: boolean | undefined | null
clockedOut?: boolean | undefined | null;
/** On premise. Are they at work (maybe working, maybe visiting). */
onPrem?: boolean | undefined | null
onPrem?: boolean | undefined | null;
/** Off premise. They aren't at the office or shop. */
offPrem?: boolean | undefined | null
offPrem?: boolean | undefined | null;
}
export interface IPermissionContractSchema extends SpruceSchema.ISchema {
id: 'permissionContract'
name: 'Permission Contract'
id: "permissionContract";
name: "Permission Contract";
fields: {
/** Clocked in. Is the person clocked in and ready to rock? */
clockedIn: {
label: 'Clocked in'
type: FieldType.Boolean
hint: 'Is the person clocked in and ready to rock?'
options: undefined
}
label: "Clocked in";
type: "boolean";
hint: "Is the person clocked in and ready to rock?";
options: undefined;
};
/** Clocked out. When someone is not working (off the clock). */
clockedOut: {
label: 'Clocked out'
type: FieldType.Boolean
hint: 'When someone is not working (off the clock).'
options: undefined
}
label: "Clocked out";
type: "boolean";
hint: "When someone is not working (off the clock).";
options: undefined;
};
/** On premise. Are they at work (maybe working, maybe visiting). */
onPrem: {
label: 'On premise'
type: FieldType.Boolean
hint: 'Are they at work (maybe working, maybe visiting).'
options: undefined
}
label: "On premise";
type: "boolean";
hint: "Are they at work (maybe working, maybe visiting).";
options: undefined;
};
/** Off premise. They aren't at the office or shop. */
offPrem: {
label: 'Off premise'
type: FieldType.Boolean
hint: "They aren't at the office or shop."
options: undefined
}
}
label: "Off premise";
type: "boolean";
hint: "They aren't at the office or shop.";
options: undefined;
};
};
}

@@ -901,3 +901,3 @@

SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
>
>;
}

@@ -10,5 +10,9 @@ export interface PluginOptions {

absoluteOrRelative?: 'relative' | 'absolute';
beVerbose?: boolean;
}
export declare function copy(options: PluginOptions): void;
export declare function resolvePathAliases(destination: string, options?: IResolvePathAliasOptions): void;
export declare function resolvePathAliases(destination: string, options?: IResolvePathAliasOptions): {
totalMappedPaths: number;
totalFilesWithMappedPaths: number;
};
export default function (_: any, options: PluginOptions): {};

@@ -9,2 +9,3 @@ "use strict";

const path_1 = __importDefault(require("path"));
const chalk_1 = __importDefault(require("chalk"));
const fs_extra_1 = __importDefault(require("fs-extra"));

@@ -28,8 +29,22 @@ const globby_1 = __importDefault(require("globby"));

exports.copy = copy;
const logStub = {
info: () => { },
warning: () => { },
error: () => { },
};
const logLive = {
info: (...message) => console.log(chalk_1.default.italic(...message)),
warning: (...message) => console.log(chalk_1.default.yellow(...message)),
error: (...message) => console.log(chalk_1.default.red(...message)),
};
function resolvePathAliases(destination, options = {}) {
let { outResolver, srcResolver } = buildResolvers(destination);
const { patterns = ['**/*.js'], absoluteOrRelative = 'relative' } = options;
const { patterns = ['**/*.js'], absoluteOrRelative = 'relative', beVerbose: isVerbose = false, } = options;
const log = isVerbose ? logLive : logStub;
let totalMappedPaths = 0;
let totalFilesWithMappedPaths = 0;
const files = globby_1.default.sync(patterns.map((pattern) => path_1.default.join(destination, '/', pattern)), {
dot: true,
});
log.info(`Checking ${files.length} files for path aliases...`);
files.forEach((file) => {

@@ -42,2 +57,3 @@ let contents = fs_1.default.readFileSync(file).toString();

let resolved;
log.info('Found', search, 'in', file);
if (outResolver) {

@@ -52,2 +68,3 @@ resolved = outResolver(search, undefined, undefined, ['.ts', '.js']);

}
totalMappedPaths++;
const relative = absoluteOrRelative === 'relative'

@@ -59,5 +76,10 @@ ? './' + path_1.default.relative(path_1.default.dirname(file), resolved)

if (found) {
totalFilesWithMappedPaths++;
fs_1.default.writeFileSync(file, contents);
}
});
return {
totalMappedPaths,
totalFilesWithMappedPaths,
};
}

@@ -64,0 +86,0 @@ exports.resolvePathAliases = resolvePathAliases;

@@ -8,2 +8,3 @@ #!/usr/bin/env node

const path_1 = __importDefault(require("path"));
const chalk_1 = __importDefault(require("chalk"));
const yargs_1 = __importDefault(require("yargs"));

@@ -18,2 +19,6 @@ const index_1 = require("./index");

},
verbose: {
alias: 'v',
desc: 'Output more information while mapping',
},
absoluteOrRelative: {

@@ -24,12 +29,19 @@ valid: '',

}).argv;
const { patterns, target, absoluteOrRelative } = argv;
const { patterns, target, absoluteOrRelative, verbose } = argv;
const cwd = target && target[0] === path_1.default.sep
? target
: path_1.default.join(process.cwd(), target !== null && target !== void 0 ? target : '');
console.log(`About to map tsconfig paths in ${cwd}`);
index_1.resolvePathAliases(cwd, {
const processCwd = process.cwd();
console.log(chalk_1.default.green(`Mapping tsconfig paths in '${path_1.default.relative(processCwd, cwd)}'`));
const results = index_1.resolvePathAliases(cwd, {
absoluteOrRelative,
patterns: patterns ? patterns.split(',') : undefined,
beVerbose: verbose,
});
console.log('Done!');
if (results.totalMappedPaths === 0) {
console.log(chalk_1.default.green.bold('Done! Nothing to map. Maybe mapping was already done? Try building your code again.'));
}
else {
console.log(chalk_1.default.green.bold(`Done! Mapped ${results.totalMappedPaths} across ${results.totalFilesWithMappedPaths} files.`));
}
//# sourceMappingURL=resolve-path-aliases.js.map

@@ -0,1 +1,8 @@

# [3.1.0](https://github.com/sprucelabsai/babel-plugin-schema/compare/v3.0.15...v3.1.0) (2020-10-12)
### Features
* beVerbose flag on cli ([7c38117](https://github.com/sprucelabsai/babel-plugin-schema/commit/7c38117))
## [3.0.15](https://github.com/sprucelabsai/babel-plugin-schema/compare/v3.0.14...v3.0.15) (2020-09-17)

@@ -2,0 +9,0 @@

{
"name": "@sprucelabs/babel-plugin-schema",
"version": "3.0.15",
"version": "3.1.0",
"description": "Builds @sprucelabs/schema and generates static paths to #spruce directories.",

@@ -25,7 +25,8 @@ "main": "build/index.js",

"upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build && yarn test",
"copy-for-tests": "yarn copy-test-files && yarn copy-test-empty-skill",
"copy-for-tests": "yarn copy-test-files",
"copy-test-files": "rm -rf ./build/__tests__/files && mkdirp ./build/__tests__/files && cp -r ./src/__tests__/files/* ./build/__tests__/files",
"copy-test-empty-skill": "rm -rf ./build/__tests__/empty_skill && mkdirp ./build/__tests__/empty_skill && cp -r ./src/__tests__/empty_skill/* ./build/__tests__/empty_skill"
"copy-test-empty-skill": "rm -rf ./build/__tests__/empty_skill && mkdirp ./build/__tests__/empty_skill"
},
"dependencies": {
"chalk": "^4.1.0",
"fs-extra": "^9.0.1",

@@ -38,13 +39,13 @@ "globby": "^11.0.1",

"devDependencies": {
"@sprucelabs/semantic-release": "^4.0.5",
"@sprucelabs/test": "^7.0.26",
"@types/fs-extra": "^9.0.1",
"@sprucelabs/semantic-release": "^4.0.6",
"@sprucelabs/test": "^7.1.3",
"@types/fs-extra": "^9.0.2",
"@types/rimraf": "^3.0.0",
"chokidar": "^3.4.2",
"concurrently": "^5.3.0",
"eslint": "^7.9.0",
"eslint-config-spruce": "^10.9.51",
"jest": "^26.4.2",
"eslint": "^7.11.0",
"eslint-config-spruce": "^10.9.91",
"jest": "^26.5.3",
"prettier": "^2.1.2",
"typescript": "^4.0.2"
"typescript": "^4.0.3"
},

@@ -51,0 +52,0 @@ "jest": {

@@ -34,26 +34,2 @@ import { exec } from 'child_process'

@test('builds and resolves without local hash spruce (direct command)')
@test('builds and resolves without local hash spruce (command line)', true)
protected static async buildsSchemaWithoutErrorWithoutLocalHashSpruce(
useCommandLine?: boolean
) {
const cwd = await this.setupNewPackage()
const fieldFactoryFile = this.fieldFactoryFilepath(cwd)
const contents = fsUtil.readFileSync(fieldFactoryFile).toString()
assert.doesInclude(contents, '#spruce')
await this.copyAndResolvePaths(cwd, { useCommandLine })
const afterMapContents = fsUtil.readFileSync(fieldFactoryFile).toString()
assert.doesNotInclude(afterMapContents, cwd)
assert.doesNotInclude(afterMapContents, '#spruce')
assert.doesInclude(
afterMapContents,
'./../.spruce/schemas/fields/fieldClassMap'
)
}
private static async copyAndResolvePaths(

@@ -204,114 +180,2 @@ cwd: string,

private static fieldFactoryFilepath(cwd: string) {
return this.resolvePath(
cwd,
'node_modules/@sprucelabs/schema',
'build/factories/FieldFactory.js'
)
}
@test('build schema and use local hash spruce version of files', false)
@test(
'build schema and use local hash spruce version of files (command line)',
true
)
protected static async buildsSchemaAndUsesTheLocalHashSpruceVersionOfFiles(
useCommandLine?: boolean
) {
const cwd = await this.setupNewPackage()
// copy schema files
const sourceHashSpruce = this.resolvePath(
cwd,
'node_modules',
'@sprucelabs/schema',
'build',
'.spruce'
)
const destinationHashSpruce = this.resolvePath(cwd, 'src', '.spruce')
await this.copyDir(sourceHashSpruce, destinationHashSpruce)
// copy schema.types example
const sourceSchemaTypes = this.resolvePath('src', '__tests__', 'files')
const schemaTypesDestination = this.resolvePath(
destinationHashSpruce,
'schemas'
)
await this.copyDir(sourceSchemaTypes, schemaTypesDestination)
await this.copyAndResolvePaths(cwd, {
useCommandLine,
patterns: ['**/*.js', '**/*.d.ts'],
})
const fieldFactoryFile = this.fieldFactoryFilepath(cwd)
const afterMapContents = fsUtil.readFileSync(fieldFactoryFile).toString()
assert.doesNotInclude(afterMapContents, '#spruce')
assert.doesInclude(
afterMapContents,
'./../../../../../build/.spruce/schemas/fields/fieldClassMap'
)
const schemaTypesFile = this.resolvePath(
schemaTypesDestination,
'schemas.types.d.ts'
)
const schemaTypesContent = fsUtil.readFileSync(schemaTypesFile).toString()
assert.doesNotInclude(schemaTypesContent, '#spruce')
assert.doesInclude(
schemaTypesContent,
'./../../../build/.spruce/schemas/fields/fieldTypeEnum'
)
}
@test()
protected static async testBuildingFullSkillWithBabel() {
const cwd = await this.setupNewCwd()
const sourceDir = this.resolvePath('src', '__tests__', 'empty_skill')
await this.copyDir(sourceDir, cwd)
const buildIndex = this.resolvePath('build', 'index.js')
const babelFile = this.resolvePath(cwd, 'babel.config.js')
let babelContents = fsUtil
.readFileSync(babelFile)
.toString()
.replace('{{schema-plugin}}', buildIndex)
fsUtil.writeFileSync(babelFile, babelContents)
await this.executeCommand(cwd, 'yarn')
await this.executeCommand(cwd, 'yarn build')
const checkFile = this.fieldFactoryFilepath(cwd)
const checkFileContents = fsUtil.readFileSync(checkFile).toString()
assert.doesNotInclude(checkFileContents, 'src/.spruce')
assert.doesInclude(
checkFileContents,
'./../../../../../build/.spruce/schemas/fields/fieldClassMap'
)
}
private static async copyDir(source: string, destination: string) {
await fsUtil.ensureDir(destination)
return new Promise((resolve) => {
exec(
`cd ${source} && tar cf - . | (cd ${destination}; tar xf -)`,
{ maxBuffer: 1024 * 1024 * 5 },
(err, stdout) => {
if (err) {
throw err
}
resolve(stdout)
}
)
})
}
private static async setupNewPackage() {

@@ -318,0 +182,0 @@ const cwd = await this.setupNewCwd()

/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-redeclare */
//@ts-ignore
import { default as SchemaEntity } from '@sprucelabs/schema'
import { default as SchemaEntity } from "@sprucelabs/schema";
//@ts-ignore
import * as SpruceSchema from '@sprucelabs/schema'
//@ts-ignore
import FieldType from '#spruce/schemas/fields/fieldTypeEnum'
import * as SpruceSchema from "@sprucelabs/schema";

@@ -13,15 +11,15 @@ export declare namespace SpruceSchemas.Spruce.v2020_07_22 {

/** Permissions grouped by slug. */
[slug: string]: string[] | undefined | null
[slug: string]: string[] | undefined | null;
}
export interface IAclSchema extends SpruceSchema.ISchema {
id: 'acl'
name: 'Access control list'
id: "acl";
name: "Access control list";
dynamicFieldSignature: {
label: 'Permissions grouped by slug'
type: FieldType.Text
keyName: 'slug'
isArray: true
options: undefined
}
label: "Permissions grouped by slug";
type: "text";
keyName: "slug";
isArray: true;
options: undefined;
};
}

@@ -31,3 +29,3 @@

SpruceSchemas.Spruce.v2020_07_22.IAclSchema
>
>;
}

@@ -39,292 +37,292 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Name. */
name: string
name: string;
/** Store number. You can use other symbols, like # or dashes. #123 or 32-US-5 */
num?: string | undefined | null
num?: string | undefined | null;
/** Public. Is this location viewable by guests? */
isPublic?: boolean | undefined | null
isPublic?: boolean | undefined | null;
/** Main Phone. */
phone?: string | undefined | null
phone?: string | undefined | null;
/** Timezone. */
timezone?:
| (
| 'etc/gmt+12'
| 'pacific/midway'
| 'pacific/honolulu'
| 'us/alaska'
| 'america/los_Angeles'
| 'america/tijuana'
| 'us/arizona'
| 'america/chihuahua'
| 'us/mountain'
| 'america/managua'
| 'us/central'
| 'america/mexico_City'
| 'Canada/Saskatchewan'
| 'america/bogota'
| 'us/eastern'
| 'us/east-indiana'
| 'Canada/atlantic'
| 'america/caracas'
| 'america/manaus'
| 'america/Santiago'
| 'Canada/Newfoundland'
| 'america/Sao_Paulo'
| 'america/argentina/buenos_Aires'
| 'america/godthab'
| 'america/montevideo'
| 'america/Noronha'
| 'atlantic/cape_Verde'
| 'atlantic/azores'
| 'africa/casablanca'
| 'etc/gmt'
| 'europe/amsterdam'
| 'europe/belgrade'
| 'europe/brussels'
| 'europe/Sarajevo'
| 'africa/lagos'
| 'asia/amman'
| 'europe/athens'
| 'asia/beirut'
| 'africa/cairo'
| 'africa/Harare'
| 'europe/Helsinki'
| 'asia/Jerusalem'
| 'europe/minsk'
| 'africa/Windhoek'
| 'asia/Kuwait'
| 'europe/moscow'
| 'africa/Nairobi'
| 'asia/tbilisi'
| 'asia/tehran'
| 'asia/muscat'
| 'asia/baku'
| 'asia/Yerevan'
| 'asia/Kabul'
| 'asia/Yekaterinburg'
| 'asia/Karachi'
| 'asia/calcutta'
| 'asia/calcutta'
| 'asia/Katmandu'
| 'asia/almaty'
| 'asia/Dhaka'
| 'asia/Rangoon'
| 'asia/bangkok'
| 'asia/Krasnoyarsk'
| 'asia/Hong_Kong'
| 'asia/Kuala_Lumpur'
| 'asia/Irkutsk'
| 'Australia/Perth'
| 'asia/taipei'
| 'asia/tokyo'
| 'asia/Seoul'
| 'asia/Yakutsk'
| 'Australia/adelaide'
| 'Australia/Darwin'
| 'Australia/brisbane'
| 'Australia/canberra'
| 'Australia/Hobart'
| 'pacific/guam'
| 'asia/Vladivostok'
| 'asia/magadan'
| 'pacific/auckland'
| 'pacific/Fiji'
| 'pacific/tongatapu'
)
| undefined
| null
| (
| "etc/gmt+12"
| "pacific/midway"
| "pacific/honolulu"
| "us/alaska"
| "america/los_Angeles"
| "america/tijuana"
| "us/arizona"
| "america/chihuahua"
| "us/mountain"
| "america/managua"
| "us/central"
| "america/mexico_City"
| "Canada/Saskatchewan"
| "america/bogota"
| "us/eastern"
| "us/east-indiana"
| "Canada/atlantic"
| "america/caracas"
| "america/manaus"
| "america/Santiago"
| "Canada/Newfoundland"
| "america/Sao_Paulo"
| "america/argentina/buenos_Aires"
| "america/godthab"
| "america/montevideo"
| "america/Noronha"
| "atlantic/cape_Verde"
| "atlantic/azores"
| "africa/casablanca"
| "etc/gmt"
| "europe/amsterdam"
| "europe/belgrade"
| "europe/brussels"
| "europe/Sarajevo"
| "africa/lagos"
| "asia/amman"
| "europe/athens"
| "asia/beirut"
| "africa/cairo"
| "africa/Harare"
| "europe/Helsinki"
| "asia/Jerusalem"
| "europe/minsk"
| "africa/Windhoek"
| "asia/Kuwait"
| "europe/moscow"
| "africa/Nairobi"
| "asia/tbilisi"
| "asia/tehran"
| "asia/muscat"
| "asia/baku"
| "asia/Yerevan"
| "asia/Kabul"
| "asia/Yekaterinburg"
| "asia/Karachi"
| "asia/calcutta"
| "asia/calcutta"
| "asia/Katmandu"
| "asia/almaty"
| "asia/Dhaka"
| "asia/Rangoon"
| "asia/bangkok"
| "asia/Krasnoyarsk"
| "asia/Hong_Kong"
| "asia/Kuala_Lumpur"
| "asia/Irkutsk"
| "Australia/Perth"
| "asia/taipei"
| "asia/tokyo"
| "asia/Seoul"
| "asia/Yakutsk"
| "Australia/adelaide"
| "Australia/Darwin"
| "Australia/brisbane"
| "Australia/canberra"
| "Australia/Hobart"
| "pacific/guam"
| "asia/Vladivostok"
| "asia/magadan"
| "pacific/auckland"
| "pacific/Fiji"
| "pacific/tongatapu"
)
| undefined
| null;
/** Address. */
address: SpruceSchema.IAddressFieldValue
address: SpruceSchema.IAddressFieldValue;
}
export interface ILocationSchema extends SpruceSchema.ISchema {
id: 'location'
name: 'Location'
description: 'A physical location where people meet. An organization has at least one of them.'
id: "location";
name: "Location";
description: "A physical location where people meet. An organization has at least one of them.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Store number. You can use other symbols, like # or dashes. #123 or 32-US-5 */
num: {
label: 'Store number'
type: FieldType.Text
hint: 'You can use other symbols, like # or dashes. #123 or 32-US-5'
options: undefined
}
label: "Store number";
type: "text";
hint: "You can use other symbols, like # or dashes. #123 or 32-US-5";
options: undefined;
};
/** Public. Is this location viewable by guests? */
isPublic: {
label: 'Public'
type: FieldType.Boolean
hint: 'Is this location viewable by guests?'
defaultValue: false
options: undefined
}
label: "Public";
type: "boolean";
hint: "Is this location viewable by guests?";
defaultValue: false;
options: undefined;
};
/** Main Phone. */
phone: {
label: 'Main Phone'
type: FieldType.Phone
options: undefined
}
label: "Main Phone";
type: "phone";
options: undefined;
};
/** Timezone. */
timezone: {
label: 'Timezone'
type: FieldType.Select
label: "Timezone";
type: "select";
options: {
choices: [
{ value: 'etc/gmt+12'; label: 'International Date Line West' },
{ value: 'pacific/midway'; label: 'Midway Island, Samoa' },
{ value: 'pacific/honolulu'; label: 'Hawaii' },
{ value: 'us/alaska'; label: 'Alaska' },
{ value: "etc/gmt+12"; label: "International Date Line West" },
{ value: "pacific/midway"; label: "Midway Island, Samoa" },
{ value: "pacific/honolulu"; label: "Hawaii" },
{ value: "us/alaska"; label: "Alaska" },
{
value: 'america/los_Angeles'
label: 'Pacific Time (US & Canada)'
value: "america/los_Angeles";
label: "Pacific Time (US & Canada)";
},
{ value: 'america/tijuana'; label: 'Tijuana, Baja California' },
{ value: 'us/arizona'; label: 'Arizona' },
{ value: "america/tijuana"; label: "Tijuana, Baja California" },
{ value: "us/arizona"; label: "Arizona" },
{
value: 'america/chihuahua'
label: 'Chihuahua, La Paz, Mazatlan'
value: "america/chihuahua";
label: "Chihuahua, La Paz, Mazatlan";
},
{ value: 'us/mountain'; label: 'Mountain Time (US & Canada)' },
{ value: 'america/managua'; label: 'Central America' },
{ value: 'us/central'; label: 'Central Time (US & Canada)' },
{ value: "us/mountain"; label: "Mountain Time (US & Canada)" },
{ value: "america/managua"; label: "Central America" },
{ value: "us/central"; label: "Central Time (US & Canada)" },
{
value: 'america/mexico_City'
label: 'Guadalajara, Mexico City, Monterrey'
value: "america/mexico_City";
label: "Guadalajara, Mexico City, Monterrey";
},
{ value: 'Canada/Saskatchewan'; label: 'Saskatchewan' },
{ value: "Canada/Saskatchewan"; label: "Saskatchewan" },
{
value: 'america/bogota'
label: 'Bogota, Lima, Quito, Rio Branco'
value: "america/bogota";
label: "Bogota, Lima, Quito, Rio Branco";
},
{ value: 'us/eastern'; label: 'Eastern Time (US & Canada)' },
{ value: 'us/east-indiana'; label: 'Indiana (East)' },
{ value: 'Canada/atlantic'; label: 'Atlantic Time (Canada)' },
{ value: 'america/caracas'; label: 'Caracas, La Paz' },
{ value: 'america/manaus'; label: 'Manaus' },
{ value: 'america/Santiago'; label: 'Santiago' },
{ value: 'Canada/Newfoundland'; label: 'Newfoundland' },
{ value: 'america/Sao_Paulo'; label: 'Brasilia' },
{ value: "us/eastern"; label: "Eastern Time (US & Canada)" },
{ value: "us/east-indiana"; label: "Indiana (East)" },
{ value: "Canada/atlantic"; label: "Atlantic Time (Canada)" },
{ value: "america/caracas"; label: "Caracas, La Paz" },
{ value: "america/manaus"; label: "Manaus" },
{ value: "america/Santiago"; label: "Santiago" },
{ value: "Canada/Newfoundland"; label: "Newfoundland" },
{ value: "america/Sao_Paulo"; label: "Brasilia" },
{
value: 'america/argentina/buenos_Aires'
label: 'Buenos Aires, Georgetown'
value: "america/argentina/buenos_Aires";
label: "Buenos Aires, Georgetown";
},
{ value: 'america/godthab'; label: 'Greenland' },
{ value: 'america/montevideo'; label: 'Montevideo' },
{ value: 'america/Noronha'; label: 'Mid-Atlantic' },
{ value: 'atlantic/cape_Verde'; label: 'Cape Verde Is.' },
{ value: 'atlantic/azores'; label: 'Azores' },
{ value: "america/godthab"; label: "Greenland" },
{ value: "america/montevideo"; label: "Montevideo" },
{ value: "america/Noronha"; label: "Mid-Atlantic" },
{ value: "atlantic/cape_Verde"; label: "Cape Verde Is." },
{ value: "atlantic/azores"; label: "Azores" },
{
value: 'africa/casablanca'
label: 'Casablanca, Monrovia, Reykjavik'
value: "africa/casablanca";
label: "Casablanca, Monrovia, Reykjavik";
},
{
value: 'etc/gmt'
label: 'Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London'
value: "etc/gmt";
label: "Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London";
},
{
value: 'europe/amsterdam'
label: 'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'
value: "europe/amsterdam";
label: "Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna";
},
{
value: 'europe/belgrade'
label: 'Belgrade, Bratislava, Budapest, Ljubljana, Prague'
value: "europe/belgrade";
label: "Belgrade, Bratislava, Budapest, Ljubljana, Prague";
},
{
value: 'europe/brussels'
label: 'Brussels, Copenhagen, Madrid, Paris'
value: "europe/brussels";
label: "Brussels, Copenhagen, Madrid, Paris";
},
{
value: 'europe/Sarajevo'
label: 'Sarajevo, Skopje, Warsaw, Zagreb'
value: "europe/Sarajevo";
label: "Sarajevo, Skopje, Warsaw, Zagreb";
},
{ value: 'africa/lagos'; label: 'West Central Africa' },
{ value: 'asia/amman'; label: 'Amman' },
{ value: 'europe/athens'; label: 'Athens, Bucharest, Istanbul' },
{ value: 'asia/beirut'; label: 'Beirut' },
{ value: 'africa/cairo'; label: 'Cairo' },
{ value: 'africa/Harare'; label: 'Harare, Pretoria' },
{ value: "africa/lagos"; label: "West Central Africa" },
{ value: "asia/amman"; label: "Amman" },
{ value: "europe/athens"; label: "Athens, Bucharest, Istanbul" },
{ value: "asia/beirut"; label: "Beirut" },
{ value: "africa/cairo"; label: "Cairo" },
{ value: "africa/Harare"; label: "Harare, Pretoria" },
{
value: 'europe/Helsinki'
label: 'Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius'
value: "europe/Helsinki";
label: "Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius";
},
{ value: 'asia/Jerusalem'; label: 'Jerusalem' },
{ value: 'europe/minsk'; label: 'Minsk' },
{ value: 'africa/Windhoek'; label: 'Windhoek' },
{ value: 'asia/Kuwait'; label: 'Kuwait, Riyadh, Baghdad' },
{ value: "asia/Jerusalem"; label: "Jerusalem" },
{ value: "europe/minsk"; label: "Minsk" },
{ value: "africa/Windhoek"; label: "Windhoek" },
{ value: "asia/Kuwait"; label: "Kuwait, Riyadh, Baghdad" },
{
value: 'europe/moscow'
label: 'Moscow, St. Petersburg, Volgograd'
value: "europe/moscow";
label: "Moscow, St. Petersburg, Volgograd";
},
{ value: 'africa/Nairobi'; label: 'Nairobi' },
{ value: 'asia/tbilisi'; label: 'Tbilisi' },
{ value: 'asia/tehran'; label: 'Tehran' },
{ value: 'asia/muscat'; label: 'Abu Dhabi, Muscat' },
{ value: 'asia/baku'; label: 'Baku' },
{ value: 'asia/Yerevan'; label: 'Yerevan' },
{ value: 'asia/Kabul'; label: 'Kabul' },
{ value: 'asia/Yekaterinburg'; label: 'Yekaterinburg' },
{ value: 'asia/Karachi'; label: 'Islamabad, Karachi, Tashkent' },
{ value: "africa/Nairobi"; label: "Nairobi" },
{ value: "asia/tbilisi"; label: "Tbilisi" },
{ value: "asia/tehran"; label: "Tehran" },
{ value: "asia/muscat"; label: "Abu Dhabi, Muscat" },
{ value: "asia/baku"; label: "Baku" },
{ value: "asia/Yerevan"; label: "Yerevan" },
{ value: "asia/Kabul"; label: "Kabul" },
{ value: "asia/Yekaterinburg"; label: "Yekaterinburg" },
{ value: "asia/Karachi"; label: "Islamabad, Karachi, Tashkent" },
{
value: 'asia/calcutta'
label: 'Chennai, Kolkata, Mumbai, New Delhi'
value: "asia/calcutta";
label: "Chennai, Kolkata, Mumbai, New Delhi";
},
{ value: 'asia/calcutta'; label: 'Sri Jayawardenapura' },
{ value: 'asia/Katmandu'; label: 'Kathmandu' },
{ value: 'asia/almaty'; label: 'Almaty, Novosibirsk' },
{ value: 'asia/Dhaka'; label: 'Astana, Dhaka' },
{ value: 'asia/Rangoon'; label: 'Yangon (Rangoon)' },
{ value: 'asia/bangkok'; label: 'Bangkok, Hanoi, Jakarta' },
{ value: 'asia/Krasnoyarsk'; label: 'Krasnoyarsk' },
{ value: "asia/calcutta"; label: "Sri Jayawardenapura" },
{ value: "asia/Katmandu"; label: "Kathmandu" },
{ value: "asia/almaty"; label: "Almaty, Novosibirsk" },
{ value: "asia/Dhaka"; label: "Astana, Dhaka" },
{ value: "asia/Rangoon"; label: "Yangon (Rangoon)" },
{ value: "asia/bangkok"; label: "Bangkok, Hanoi, Jakarta" },
{ value: "asia/Krasnoyarsk"; label: "Krasnoyarsk" },
{
value: 'asia/Hong_Kong'
label: 'Beijing, Chongqing, Hong Kong, Urumqi'
value: "asia/Hong_Kong";
label: "Beijing, Chongqing, Hong Kong, Urumqi";
},
{ value: 'asia/Kuala_Lumpur'; label: 'Kuala Lumpur, Singapore' },
{ value: 'asia/Irkutsk'; label: 'Irkutsk, Ulaan Bataar' },
{ value: 'Australia/Perth'; label: 'Perth' },
{ value: 'asia/taipei'; label: 'Taipei' },
{ value: 'asia/tokyo'; label: 'Osaka, Sapporo, Tokyo' },
{ value: 'asia/Seoul'; label: 'Seoul' },
{ value: 'asia/Yakutsk'; label: 'Yakutsk' },
{ value: 'Australia/adelaide'; label: 'Adelaide' },
{ value: 'Australia/Darwin'; label: 'Darwin' },
{ value: 'Australia/brisbane'; label: 'Brisbane' },
{ value: "asia/Kuala_Lumpur"; label: "Kuala Lumpur, Singapore" },
{ value: "asia/Irkutsk"; label: "Irkutsk, Ulaan Bataar" },
{ value: "Australia/Perth"; label: "Perth" },
{ value: "asia/taipei"; label: "Taipei" },
{ value: "asia/tokyo"; label: "Osaka, Sapporo, Tokyo" },
{ value: "asia/Seoul"; label: "Seoul" },
{ value: "asia/Yakutsk"; label: "Yakutsk" },
{ value: "Australia/adelaide"; label: "Adelaide" },
{ value: "Australia/Darwin"; label: "Darwin" },
{ value: "Australia/brisbane"; label: "Brisbane" },
{
value: 'Australia/canberra'
label: 'Canberra, Melbourne, Sydney'
value: "Australia/canberra";
label: "Canberra, Melbourne, Sydney";
},
{ value: 'Australia/Hobart'; label: 'Hobart' },
{ value: 'pacific/guam'; label: 'Guam, Port Moresby' },
{ value: 'asia/Vladivostok'; label: 'Vladivostok' },
{ value: "Australia/Hobart"; label: "Hobart" },
{ value: "pacific/guam"; label: "Guam, Port Moresby" },
{ value: "asia/Vladivostok"; label: "Vladivostok" },
{
value: 'asia/magadan'
label: 'Magadan, Solomon Is., New Caledonia'
value: "asia/magadan";
label: "Magadan, Solomon Is., New Caledonia";
},
{ value: 'pacific/auckland'; label: 'Auckland, Wellington' },
{ value: 'pacific/Fiji'; label: 'Fiji, Kamchatka, Marshall Is.' },
{ value: 'pacific/tongatapu'; label: "Nuku'alofa" }
]
}
}
{ value: "pacific/auckland"; label: "Auckland, Wellington" },
{ value: "pacific/Fiji"; label: "Fiji, Kamchatka, Marshall Is." },
{ value: "pacific/tongatapu"; label: "Nuku'alofa" }
];
};
};
/** Address. */
address: {
label: 'Address'
type: FieldType.Address
isRequired: true
options: undefined
}
}
label: "Address";
type: "address";
isRequired: true;
options: undefined;
};
};
}

@@ -334,3 +332,3 @@

SpruceSchemas.Spruce.v2020_07_22.ILocationSchema
>
>;
}

@@ -342,69 +340,69 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Is default. Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest). */
isDefault: string
isDefault: string;
/** Name. */
name: string
name: string;
/** Role. */
role: 'owner' | 'groupManager' | 'manager' | 'teammate' | 'guest'
role: "owner" | "groupManager" | "manager" | "teammate" | "guest";
/** On work permissions. */
inStoreAcls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null
inStoreAcls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null;
/** Off work permissions. */
acls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null
acls?: SpruceSchemas.Spruce.v2020_07_22.IAcl | undefined | null;
}
export interface IJobSchema extends SpruceSchema.ISchema {
id: 'job'
name: 'Job'
description: 'A position at a company. The answer to the question; What is your job?'
id: "job";
name: "Job";
description: "A position at a company. The answer to the question; What is your job?";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Is default. Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest). */
isDefault: {
label: 'Is default'
type: FieldType.Text
isRequired: true
hint: 'Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest).'
options: undefined
}
label: "Is default";
type: "text";
isRequired: true;
hint: "Is this job one that comes with every org? Mapped to roles (owner, groupManager, manager, guest).";
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Role. */
role: {
label: 'Role'
type: FieldType.Select
isRequired: true
label: "Role";
type: "select";
isRequired: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** On work permissions. */
inStoreAcls: {
label: 'On work permissions'
type: FieldType.Schema
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema }
}
label: "On work permissions";
type: 'schema',
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema };
};
/** Off work permissions. */
acls: {
label: 'Off work permissions'
type: FieldType.Schema
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema }
}
}
label: "Off work permissions";
type: 'schema',
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IAclSchema };
};
};
}

@@ -414,3 +412,3 @@

SpruceSchemas.Spruce.v2020_07_22.IJobSchema
>
>;
}

@@ -422,69 +420,69 @@

/** Id. */
id: string
id: string;
/** First name. */
firstName?: string | undefined | null
firstName?: string | undefined | null;
/** Last name. */
lastName?: string | undefined | null
lastName?: string | undefined | null;
/** Casual name. The name you can use when talking to this person. */
casualName: string
casualName: string;
/** Phone. A number that can be texted */
phone?: string | undefined | null
phone?: string | undefined | null;
/** Profile photos. */
profileImages?:
| SpruceSchemas.Spruce.v2020_07_22.IProfileImage
| undefined
| null
| SpruceSchemas.Spruce.v2020_07_22.IProfileImage
| undefined
| null;
}
export interface IPersonSchema extends SpruceSchema.ISchema {
id: 'person'
name: 'Person'
description: 'A human being.'
id: "person";
name: "Person";
description: "A human being.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isRequired: true;
options: undefined;
};
/** First name. */
firstName: {
label: 'First name'
type: FieldType.Text
isPrivate: true
options: undefined
}
label: "First name";
type: "text";
isPrivate: true;
options: undefined;
};
/** Last name. */
lastName: {
label: 'Last name'
type: FieldType.Text
isPrivate: true
options: undefined
}
label: "Last name";
type: "text";
isPrivate: true;
options: undefined;
};
/** Casual name. The name you can use when talking to this person. */
casualName: {
label: 'Casual name'
type: FieldType.Text
isRequired: true
hint: 'The name you can use when talking to this person.'
options: undefined
}
label: "Casual name";
type: "text";
isRequired: true;
hint: "The name you can use when talking to this person.";
options: undefined;
};
/** Phone. A number that can be texted */
phone: {
label: 'Phone'
type: FieldType.Phone
isPrivate: true
hint: 'A number that can be texted'
options: undefined
}
label: "Phone";
type: "phone";
isPrivate: true;
hint: "A number that can be texted";
options: undefined;
};
/** Profile photos. */
profileImages: {
label: 'Profile photos'
type: FieldType.Schema
label: "Profile photos";
type: 'schema',
options: {
schema: SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema
}
}
}
schema: SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema;
};
};
};
}

@@ -494,3 +492,3 @@

SpruceSchemas.Spruce.v2020_07_22.IPersonSchema
>
>;
}

@@ -502,95 +500,95 @@

/** Id. */
id?: string | undefined | null
id?: string | undefined | null;
/** Name. */
roles: 'owner' | 'groupManager' | 'manager' | 'teammate' | 'guest'
roles: "owner" | "groupManager" | "manager" | "teammate" | "guest";
/** Status. */
status?: string | undefined | null
status?: string | undefined | null;
/** Total visits. */
visits: number
visits: number;
/** Last visit. */
lastRecordedVisit?: SpruceSchema.IDateTimeFieldValue | undefined | null
lastRecordedVisit?: SpruceSchema.IDateTimeFieldValue | undefined | null;
/** Job. */
job: SpruceSchemas.Spruce.v2020_07_22.IJob
job: SpruceSchemas.Spruce.v2020_07_22.IJob;
/** Location. */
location: SpruceSchemas.Spruce.v2020_07_22.ILocation
location: SpruceSchemas.Spruce.v2020_07_22.ILocation;
/** Person. */
person: SpruceSchemas.Spruce.v2020_07_22.IPerson
person: SpruceSchemas.Spruce.v2020_07_22.IPerson;
}
export interface IPersonLocationSchema extends SpruceSchema.ISchema {
id: 'personLocation'
name: 'Person location'
description: "A person's visit to a location (business or home)."
id: "personLocation";
name: "Person location";
description: "A person's visit to a location (business or home).";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
options: undefined
}
label: "Id";
type: "id";
options: undefined;
};
/** Name. */
roles: {
label: 'Name'
type: FieldType.Select
isRequired: true
isArray: true
label: "Name";
type: "select";
isRequired: true;
isArray: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** Status. */
status: {
label: 'Status'
type: FieldType.Text
options: undefined
}
label: "Status";
type: "text";
options: undefined;
};
/** Total visits. */
visits: {
label: 'Total visits'
type: FieldType.Number
isRequired: true
label: "Total visits";
type: 'number';
isRequired: true;
options: {
choices: [
{ value: 'owner'; label: 'Owner' },
{ value: 'groupManager'; label: 'District/region manager' },
{ value: 'manager'; label: 'Manager' },
{ value: 'teammate'; label: 'Teammate' },
{ value: 'guest'; label: 'Guest' }
]
}
}
{ value: "owner"; label: "Owner" },
{ value: "groupManager"; label: "District/region manager" },
{ value: "manager"; label: "Manager" },
{ value: "teammate"; label: "Teammate" },
{ value: "guest"; label: "Guest" }
];
};
};
/** Last visit. */
lastRecordedVisit: {
label: 'Last visit'
type: FieldType.DateTime
options: undefined
}
label: "Last visit";
type: 'dateTime',
options: undefined;
};
/** Job. */
job: {
label: 'Job'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IJobSchema }
}
label: "Job";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IJobSchema };
};
/** Location. */
location: {
label: 'Location'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.ILocationSchema }
}
label: "Location";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.ILocationSchema };
};
/** Person. */
person: {
label: 'Person'
type: FieldType.Schema
isRequired: true
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IPersonSchema }
}
}
label: "Person";
type: 'schema',
isRequired: true;
options: { schema: SpruceSchemas.Spruce.v2020_07_22.IPersonSchema };
};
};
}

@@ -600,3 +598,3 @@

SpruceSchemas.Spruce.v2020_07_22.IPersonLocationSchema
>
>;
}

@@ -608,45 +606,45 @@

/** 60x60. */
profile60: string
profile60: string;
/** 150x150. */
profile150: string
profile150: string;
/** 60x60. */
'profile60@2x': string
"profile60@2x": string;
/** 150x150. */
'profile150@2x': string
"profile150@2x": string;
}
export interface IProfileImageSchema extends SpruceSchema.ISchema {
id: 'profileImage'
name: 'Profile Image Sizes'
description: 'Various sizes that a profile image comes in.'
id: "profileImage";
name: "Profile Image Sizes";
description: "Various sizes that a profile image comes in.";
fields: {
/** 60x60. */
profile60: {
label: '60x60'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "60x60";
type: "text";
isRequired: true;
options: undefined;
};
/** 150x150. */
profile150: {
label: '150x150'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "150x150";
type: "text";
isRequired: true;
options: undefined;
};
/** 60x60. */
'profile60@2x': {
label: '60x60'
type: FieldType.Text
isRequired: true
options: undefined
}
"profile60@2x": {
label: "60x60";
type: "text";
isRequired: true;
options: undefined;
};
/** 150x150. */
'profile150@2x': {
label: '150x150'
type: FieldType.Text
isRequired: true
options: undefined
}
}
"profile150@2x": {
label: "150x150";
type: "text";
isRequired: true;
options: undefined;
};
};
}

@@ -656,3 +654,3 @@

SpruceSchemas.Spruce.v2020_07_22.IProfileImageSchema
>
>;
}

@@ -662,22 +660,22 @@

export interface ISkillCreator {
skillId?: string | undefined | null
skillId?: string | undefined | null;
personId?: string | undefined | null
personId?: string | undefined | null;
}
export interface ISkillCreatorSchema extends SpruceSchema.ISchema {
id: 'skillCreator'
name: 'Skill creator'
id: "skillCreator";
name: "Skill creator";
fields: {
/** . */
skillId: {
type: FieldType.Text
options: undefined
}
type: "text";
options: undefined;
};
/** . */
personId: {
type: FieldType.Text
options: undefined
}
}
type: "text";
options: undefined;
};
};
}

@@ -687,3 +685,3 @@

SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema
>
>;
}

@@ -695,68 +693,68 @@

/** Id. */
id: string
id: string;
/** Id. */
apiKey: string
apiKey: string;
/** Name. */
name: string
name: string;
/** Description. */
description?: string | undefined | null
description?: string | undefined | null;
/** Slug. */
slug: string
slug: string;
/** Creators. The people or skills who created and own this skill. */
creators: SpruceSchemas.Spruce.v2020_07_22.ISkillCreator[]
creators: SpruceSchemas.Spruce.v2020_07_22.ISkillCreator[];
}
export interface ISkillSchema extends SpruceSchema.ISchema {
id: 'skill'
name: 'Skill'
description: 'An ability Sprucebot has learned.'
id: "skill";
name: "Skill";
description: "An ability Sprucebot has learned.";
fields: {
/** Id. */
id: {
label: 'Id'
type: FieldType.Id
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isRequired: true;
options: undefined;
};
/** Id. */
apiKey: {
label: 'Id'
type: FieldType.Id
isPrivate: true
isRequired: true
options: undefined
}
label: "Id";
type: "id";
isPrivate: true;
isRequired: true;
options: undefined;
};
/** Name. */
name: {
label: 'Name'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Name";
type: "text";
isRequired: true;
options: undefined;
};
/** Description. */
description: {
label: 'Description'
type: FieldType.Text
options: undefined
}
label: "Description";
type: "text";
options: undefined;
};
/** Slug. */
slug: {
label: 'Slug'
type: FieldType.Text
isRequired: true
options: undefined
}
label: "Slug";
type: "text";
isRequired: true;
options: undefined;
};
/** Creators. The people or skills who created and own this skill. */
creators: {
label: 'Creators'
type: FieldType.Schema
isPrivate: true
isRequired: true
hint: 'The people or skills who created and own this skill.'
isArray: true
label: "Creators";
type: 'schema',
isPrivate: true;
isRequired: true;
hint: "The people or skills who created and own this skill.";
isArray: true;
options: {
schema: SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema
}
}
}
schema: SpruceSchemas.Spruce.v2020_07_22.ISkillCreatorSchema;
};
};
};
}

@@ -766,3 +764,3 @@

SpruceSchemas.Spruce.v2020_07_22.ISkillSchema
>
>;
}

@@ -772,46 +770,46 @@

export interface IEventSignature {
responsePayload?: SpruceSchema.ISchema | undefined | null
responsePayload?: SpruceSchema.ISchema | undefined | null;
emitPayload?: SpruceSchema.ISchema | undefined | null
emitPayload?: SpruceSchema.ISchema | undefined | null;
listenPermissionsAny?:
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null;
emitPermissionsAny?:
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IPermissionContract
| undefined
| null;
}
export interface IEventSignatureSchema extends SpruceSchema.ISchema {
id: 'eventSignature'
name: 'Event Signature'
id: "eventSignature";
name: "Event Signature";
fields: {
/** . */
responsePayload: {
type: FieldType.Raw
options: { valueType: `SpruceSchema.ISchema` }
}
type: 'raw';
options: { valueType: `SpruceSchema.ISchema` };
};
/** . */
emitPayload: {
type: FieldType.Raw
options: { valueType: `SpruceSchema.ISchema` }
}
type: 'raw';
options: { valueType: `SpruceSchema.ISchema` };
};
/** . */
listenPermissionsAny: {
type: FieldType.Schema
type: 'schema',
options: {
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
}
}
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema;
};
};
/** . */
emitPermissionsAny: {
type: FieldType.Schema
type: 'schema',
options: {
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
}
}
}
schema: SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema;
};
};
};
}

@@ -821,3 +819,3 @@

SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema
>
>;
}

@@ -829,15 +827,17 @@

[eventNameWithOptionalNamespace: string]:
| SpruceSchemas.Local.v2020_09_01.IEventSignature
| undefined
| null
| SpruceSchemas.Local.v2020_09_01.IEventSignature
| undefined
| null;
}
export interface IMercuryContractSchema extends SpruceSchema.ISchema {
id: 'mercuryContract'
name: 'Mercury Contract'
id: "mercuryContract";
name: "Mercury Contract";
dynamicFieldSignature: {
type: FieldType.Schema
keyName: 'eventNameWithOptionalNamespace'
options: { schema: SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema }
}
type: 'schema',
keyName: "eventNameWithOptionalNamespace";
options: {
schema: SpruceSchemas.Local.v2020_09_01.IEventSignatureSchema;
};
};
}

@@ -847,3 +847,3 @@

SpruceSchemas.Local.v2020_09_01.IMercuryContractSchema
>
>;
}

@@ -854,44 +854,44 @@

/** Clocked in. Is the person clocked in and ready to rock? */
clockedIn?: boolean | undefined | null
clockedIn?: boolean | undefined | null;
/** Clocked out. When someone is not working (off the clock). */
clockedOut?: boolean | undefined | null
clockedOut?: boolean | undefined | null;
/** On premise. Are they at work (maybe working, maybe visiting). */
onPrem?: boolean | undefined | null
onPrem?: boolean | undefined | null;
/** Off premise. They aren't at the office or shop. */
offPrem?: boolean | undefined | null
offPrem?: boolean | undefined | null;
}
export interface IPermissionContractSchema extends SpruceSchema.ISchema {
id: 'permissionContract'
name: 'Permission Contract'
id: "permissionContract";
name: "Permission Contract";
fields: {
/** Clocked in. Is the person clocked in and ready to rock? */
clockedIn: {
label: 'Clocked in'
type: FieldType.Boolean
hint: 'Is the person clocked in and ready to rock?'
options: undefined
}
label: "Clocked in";
type: "boolean";
hint: "Is the person clocked in and ready to rock?";
options: undefined;
};
/** Clocked out. When someone is not working (off the clock). */
clockedOut: {
label: 'Clocked out'
type: FieldType.Boolean
hint: 'When someone is not working (off the clock).'
options: undefined
}
label: "Clocked out";
type: "boolean";
hint: "When someone is not working (off the clock).";
options: undefined;
};
/** On premise. Are they at work (maybe working, maybe visiting). */
onPrem: {
label: 'On premise'
type: FieldType.Boolean
hint: 'Are they at work (maybe working, maybe visiting).'
options: undefined
}
label: "On premise";
type: "boolean";
hint: "Are they at work (maybe working, maybe visiting).";
options: undefined;
};
/** Off premise. They aren't at the office or shop. */
offPrem: {
label: 'Off premise'
type: FieldType.Boolean
hint: "They aren't at the office or shop."
options: undefined
}
}
label: "Off premise";
type: "boolean";
hint: "They aren't at the office or shop.";
options: undefined;
};
};
}

@@ -901,3 +901,3 @@

SpruceSchemas.Local.v2020_09_01.IPermissionContractSchema
>
>;
}
import fs from 'fs'
import pathUtil from 'path'
import chalk from 'chalk'
import fsExtra from 'fs-extra'

@@ -29,2 +30,3 @@ import globby from 'globby'

absoluteOrRelative?: 'relative' | 'absolute'
beVerbose?: boolean
}

@@ -49,2 +51,14 @@

const logStub = {
info: () => {},
warning: () => {},
error: () => {},
}
const logLive = {
info: (...message: string[]) => console.log(chalk.italic(...message)),
warning: (...message: string[]) => console.log(chalk.yellow(...message)),
error: (...message: string[]) => console.log(chalk.red(...message)),
}
export function resolvePathAliases(

@@ -56,4 +70,12 @@ destination: string,

const { patterns = ['**/*.js'], absoluteOrRelative = 'relative' } = options
const {
patterns = ['**/*.js'],
absoluteOrRelative = 'relative',
beVerbose: isVerbose = false,
} = options
const log = isVerbose ? logLive : logStub
let totalMappedPaths = 0
let totalFilesWithMappedPaths = 0
const files = globby.sync(

@@ -66,2 +88,4 @@ patterns.map((pattern) => pathUtil.join(destination, '/', pattern)),

log.info(`Checking ${files.length} files for path aliases...`)
files.forEach((file) => {

@@ -78,2 +102,4 @@ let contents = fs.readFileSync(file).toString()

log.info('Found', search, 'in', file)
if (outResolver) {

@@ -91,2 +117,4 @@ resolved = outResolver(search, undefined, undefined, ['.ts', '.js'])

totalMappedPaths++
const relative =

@@ -101,5 +129,11 @@ absoluteOrRelative === 'relative'

if (found) {
totalFilesWithMappedPaths++
fs.writeFileSync(file, contents)
}
})
return {
totalMappedPaths,
totalFilesWithMappedPaths,
}
}

@@ -106,0 +140,0 @@

#!/usr/bin/env node
import pathUtil from 'path'
import chalk from 'chalk'
import yargs from 'yargs'

@@ -13,2 +14,6 @@ import { resolvePathAliases } from './index'

},
verbose: {
alias: 'v',
desc: 'Output more information while mapping',
},
absoluteOrRelative: {

@@ -21,6 +26,7 @@ valid: '',

const { patterns, target, absoluteOrRelative } = argv as {
const { patterns, target, absoluteOrRelative, verbose } = argv as {
patterns?: string
target?: string
absoluteOrRelative?: 'relative' | 'absolute'
verbose?: boolean
}

@@ -32,7 +38,27 @@ const cwd =

console.log(`About to map tsconfig paths in ${cwd}`)
resolvePathAliases(cwd, {
const processCwd = process.cwd()
console.log(
chalk.green(
`Mapping tsconfig paths in '${pathUtil.relative(processCwd, cwd)}'`
)
)
const results = resolvePathAliases(cwd, {
absoluteOrRelative,
patterns: patterns ? patterns.split(',') : undefined,
beVerbose: verbose,
})
console.log('Done!')
if (results.totalMappedPaths === 0) {
console.log(
chalk.green.bold(
'Done! Nothing to map. Maybe mapping was already done? Try building your code again.'
)
)
} else {
console.log(
chalk.green.bold(
`Done! Mapped ${results.totalMappedPaths} across ${results.totalFilesWithMappedPaths} files.`
)
)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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