@slicemachine/manager 0.24.4-alpha.xru-kong-obelix-services.1 → 0.24.4-alpha.xru-poc-ai.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/constants/API_ENDPOINTS.cjs +6 -6
- package/dist/constants/API_ENDPOINTS.cjs.map +1 -1
- package/dist/constants/API_ENDPOINTS.js +6 -6
- package/dist/constants/API_ENDPOINTS.js.map +1 -1
- package/dist/managers/slices/SlicesManager.cjs +678 -0
- package/dist/managers/slices/SlicesManager.cjs.map +1 -1
- package/dist/managers/slices/SlicesManager.d.ts +11 -0
- package/dist/managers/slices/SlicesManager.js +678 -0
- package/dist/managers/slices/SlicesManager.js.map +1 -1
- package/package.json +5 -3
- package/src/constants/API_ENDPOINTS.ts +6 -6
- package/src/managers/slices/SlicesManager.ts +738 -0
@@ -48,8 +48,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
48
48
|
PrismicEmbed: "https://oembed.wroom.io",
|
49
49
|
PrismicUnsplash: "https://unsplash.wroom.io/",
|
50
50
|
SliceMachineV1: "https://sm-api.wroom.io/v1/",
|
51
|
-
RepositoryService: "https://
|
52
|
-
LocaleService: "https://
|
51
|
+
RepositoryService: "https://repository.internal.wroom.io/",
|
52
|
+
LocaleService: "https://locale.internal.wroom.io/"
|
53
53
|
};
|
54
54
|
}
|
55
55
|
case APPLICATION_MODE.APPLICATION_MODE.DevTools:
|
@@ -64,8 +64,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
64
64
|
PrismicEmbed: `https://oembed.${process.env.SM_ENV}-wroom.com`,
|
65
65
|
PrismicUnsplash: `https://unsplash.${process.env.SM_ENV}-wroom.com/`,
|
66
66
|
SliceMachineV1: `https://sm-api.${process.env.SM_ENV}-wroom.com/v1/`,
|
67
|
-
RepositoryService: `https://
|
68
|
-
LocaleService: `https://
|
67
|
+
RepositoryService: `https://repository.internal.${process.env.SM_ENV}-wroom.com/`,
|
68
|
+
LocaleService: `https://locale.internal.${process.env.SM_ENV}-wroom.com/`
|
69
69
|
};
|
70
70
|
}
|
71
71
|
case APPLICATION_MODE.APPLICATION_MODE.Production:
|
@@ -79,8 +79,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
79
79
|
PrismicEmbed: "https://oembed.prismic.io",
|
80
80
|
PrismicUnsplash: "https://unsplash.prismic.io/",
|
81
81
|
SliceMachineV1: "https://sm-api.prismic.io/v1/",
|
82
|
-
RepositoryService: "https://
|
83
|
-
LocaleService: "https://
|
82
|
+
RepositoryService: "https://repository.internal.prismic.io/",
|
83
|
+
LocaleService: "https://locale.internal.prismic.io/"
|
84
84
|
};
|
85
85
|
}
|
86
86
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"API_ENDPOINTS.cjs","sources":["../../../src/constants/API_ENDPOINTS.ts"],"sourcesContent":["import { addTrailingSlash, removeTrailingSlash } from \"../lib/trailingSlash\";\nimport { APPLICATION_MODE } from \"./APPLICATION_MODE\";\n\nexport type APIEndpoints = {\n\tPrismicWroom: string;\n\tPrismicAuthentication: string;\n\tPrismicModels: string;\n\tPrismicUser: string;\n\tAwsAclProvider: string;\n\tPrismicEmbed: string;\n\tPrismicUnsplash: string;\n\tSliceMachineV1: string;\n\tRepositoryService: string;\n\tLocaleService: string;\n};\n\nexport const API_ENDPOINTS: APIEndpoints = (() => {\n\tswitch (process.env.SM_ENV) {\n\t\tcase APPLICATION_MODE.Development: {\n\t\t\tconst apiEndpoints = {\n\t\t\t\tPrismicWroom: addTrailingSlash(process.env.wroom_endpoint),\n\t\t\t\tPrismicAuthentication: addTrailingSlash(\n\t\t\t\t\tprocess.env.authentication_server_endpoint,\n\t\t\t\t),\n\t\t\t\tPrismicModels: addTrailingSlash(process.env.customtypesapi_endpoint),\n\t\t\t\tPrismicUser: addTrailingSlash(process.env.user_service_endpoint),\n\t\t\t\tAwsAclProvider: addTrailingSlash(process.env.acl_provider_endpoint),\n\t\t\t\tPrismicEmbed: removeTrailingSlash(\n\t\t\t\t\tprocess.env.oembed_endpoint ?? \"https://oembed.wroom.io\",\n\t\t\t\t),\n\t\t\t\tPrismicUnsplash: addTrailingSlash(\n\t\t\t\t\tprocess.env.unsplash_endpoint ?? \"https://unsplash.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tSliceMachineV1: addTrailingSlash(\n\t\t\t\t\tprocess.env.slice_machine_v1_endpoint ??\n\t\t\t\t\t\t\"https://sm-api.wroom.io/v1/\",\n\t\t\t\t),\n\t\t\t\tRepositoryService: addTrailingSlash(\n\t\t\t\t\tprocess.env.repository_api ?? \"https://repository.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tLocaleService: addTrailingSlash(\n\t\t\t\t\tprocess.env.locale_api ?? \"https://locale.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tconst missingAPIEndpoints = Object.keys(apiEndpoints).filter((key) => {\n\t\t\t\treturn !apiEndpoints[key as keyof typeof apiEndpoints];\n\t\t\t});\n\n\t\t\tif (missingAPIEndpoints.length > 0) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t\t\t}) where API endpoints are configured via environment variables.\n\nThe following endpoints were not configured: ${missingAPIEndpoints.join(\", \")}.\n\nConfigure them before continuing.`,\n\t\t\t\t);\n\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconsole.warn(`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t}).\n\nThe following API endpoints were configured via environment variables:\n${Object.entries(apiEndpoints)\n\t.map(([name, endpoint]) => ` - ${name}: ${endpoint}`)\n\t.join(\"\\n\")}\n\nThese endpoints are different than Slice Machine's normal endpoints and are not trusted.\n\nIf you didn't intend to run Slice Machine this way, stop it immediately and unset the SM_ENV environment variable.`);\n\n\t\t\treturn apiEndpoints as APIEndpoints;\n\t\t}\n\n\t\tcase APPLICATION_MODE.Staging: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://wroom.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.wroom.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.wroom.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.wroom.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.wroom.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.wroom.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.wroom.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.wroom.io/v1/\",\n\t\t\t\tRepositoryService: \"https://
|
1
|
+
{"version":3,"file":"API_ENDPOINTS.cjs","sources":["../../../src/constants/API_ENDPOINTS.ts"],"sourcesContent":["import { addTrailingSlash, removeTrailingSlash } from \"../lib/trailingSlash\";\nimport { APPLICATION_MODE } from \"./APPLICATION_MODE\";\n\nexport type APIEndpoints = {\n\tPrismicWroom: string;\n\tPrismicAuthentication: string;\n\tPrismicModels: string;\n\tPrismicUser: string;\n\tAwsAclProvider: string;\n\tPrismicEmbed: string;\n\tPrismicUnsplash: string;\n\tSliceMachineV1: string;\n\tRepositoryService: string;\n\tLocaleService: string;\n};\n\nexport const API_ENDPOINTS: APIEndpoints = (() => {\n\tswitch (process.env.SM_ENV) {\n\t\tcase APPLICATION_MODE.Development: {\n\t\t\tconst apiEndpoints = {\n\t\t\t\tPrismicWroom: addTrailingSlash(process.env.wroom_endpoint),\n\t\t\t\tPrismicAuthentication: addTrailingSlash(\n\t\t\t\t\tprocess.env.authentication_server_endpoint,\n\t\t\t\t),\n\t\t\t\tPrismicModels: addTrailingSlash(process.env.customtypesapi_endpoint),\n\t\t\t\tPrismicUser: addTrailingSlash(process.env.user_service_endpoint),\n\t\t\t\tAwsAclProvider: addTrailingSlash(process.env.acl_provider_endpoint),\n\t\t\t\tPrismicEmbed: removeTrailingSlash(\n\t\t\t\t\tprocess.env.oembed_endpoint ?? \"https://oembed.wroom.io\",\n\t\t\t\t),\n\t\t\t\tPrismicUnsplash: addTrailingSlash(\n\t\t\t\t\tprocess.env.unsplash_endpoint ?? \"https://unsplash.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tSliceMachineV1: addTrailingSlash(\n\t\t\t\t\tprocess.env.slice_machine_v1_endpoint ??\n\t\t\t\t\t\t\"https://sm-api.wroom.io/v1/\",\n\t\t\t\t),\n\t\t\t\tRepositoryService: addTrailingSlash(\n\t\t\t\t\tprocess.env.repository_api ?? \"https://repository.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tLocaleService: addTrailingSlash(\n\t\t\t\t\tprocess.env.locale_api ?? \"https://locale.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tconst missingAPIEndpoints = Object.keys(apiEndpoints).filter((key) => {\n\t\t\t\treturn !apiEndpoints[key as keyof typeof apiEndpoints];\n\t\t\t});\n\n\t\t\tif (missingAPIEndpoints.length > 0) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t\t\t}) where API endpoints are configured via environment variables.\n\nThe following endpoints were not configured: ${missingAPIEndpoints.join(\", \")}.\n\nConfigure them before continuing.`,\n\t\t\t\t);\n\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconsole.warn(`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t}).\n\nThe following API endpoints were configured via environment variables:\n${Object.entries(apiEndpoints)\n\t.map(([name, endpoint]) => ` - ${name}: ${endpoint}`)\n\t.join(\"\\n\")}\n\nThese endpoints are different than Slice Machine's normal endpoints and are not trusted.\n\nIf you didn't intend to run Slice Machine this way, stop it immediately and unset the SM_ENV environment variable.`);\n\n\t\t\treturn apiEndpoints as APIEndpoints;\n\t\t}\n\n\t\tcase APPLICATION_MODE.Staging: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://wroom.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.wroom.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.wroom.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.wroom.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.wroom.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.wroom.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.wroom.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.wroom.io/v1/\",\n\t\t\t\tRepositoryService: \"https://repository.internal.wroom.io/\",\n\t\t\t\tLocaleService: \"https://locale.internal.wroom.io/\",\n\t\t\t};\n\t\t}\n\n\t\tcase APPLICATION_MODE.DevTools:\n\t\tcase APPLICATION_MODE.MarketingTools:\n\t\tcase APPLICATION_MODE.Platform: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: `https://${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicAuthentication: `https://auth.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicModels: `https://customtypes.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicUser: `https://user-service.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tAwsAclProvider: `https://acl-provider.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicEmbed: `https://oembed.${process.env.SM_ENV}-wroom.com`,\n\t\t\t\tPrismicUnsplash: `https://unsplash.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tSliceMachineV1: `https://sm-api.${process.env.SM_ENV}-wroom.com/v1/`,\n\t\t\t\tRepositoryService: `https://repository.internal.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tLocaleService: `https://locale.internal.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t};\n\t\t}\n\n\t\tcase APPLICATION_MODE.Production:\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://prismic.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.prismic.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.prismic.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.prismic.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.prismic.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.prismic.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.prismic.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.prismic.io/v1/\",\n\t\t\t\tRepositoryService: \"https://repository.internal.prismic.io/\",\n\t\t\t\tLocaleService: \"https://locale.internal.prismic.io/\",\n\t\t\t};\n\t\t}\n\t}\n})();\n"],"names":["APPLICATION_MODE","addTrailingSlash","removeTrailingSlash"],"mappings":";;;;AAgBO,MAAM,iBAA+B,MAAK;AACxC,UAAA,QAAQ,IAAI,QAAQ;AAAA,IAC3B,KAAKA,iBAAAA,iBAAiB,aAAa;AAClC,YAAM,eAAe;AAAA,QACpB,cAAcC,cAAA,iBAAiB,QAAQ,IAAI,cAAc;AAAA,QACzD,uBAAuBA,cAAA,iBACtB,QAAQ,IAAI,8BAA8B;AAAA,QAE3C,eAAeA,cAAA,iBAAiB,QAAQ,IAAI,uBAAuB;AAAA,QACnE,aAAaA,cAAA,iBAAiB,QAAQ,IAAI,qBAAqB;AAAA,QAC/D,gBAAgBA,cAAA,iBAAiB,QAAQ,IAAI,qBAAqB;AAAA,QAClE,cAAcC,cAAAA,oBACb,QAAQ,IAAI,mBAAmB,yBAAyB;AAAA,QAEzD,iBAAiBD,cAAAA,iBAChB,QAAQ,IAAI,qBAAqB,4BAA4B;AAAA,QAE9D,gBAAgBA,cAAAA,iBACf,QAAQ,IAAI,6BACX,6BAA6B;AAAA,QAE/B,mBAAmBA,cAAAA,iBAClB,QAAQ,IAAI,kBAAkB,uCAAuC;AAAA,QAEtE,eAAeA,cAAAA,iBACd,QAAQ,IAAI,cAAc,mCAAmC;AAAA,MAAA;AAI/D,YAAM,sBAAsB,OAAO,KAAK,YAAY,EAAE,OAAO,CAAC,QAAO;AAC7D,eAAA,CAAC,aAAa,GAA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A;AAAA,IAExD;AAAA,IAEA,KAAKA,iBAAAA,iBAAiB;AAAA,IACtB,SAAS;AACD,aAAA;AAAA,QACN,cAAc;AAAA,QACd,uBAAuB;AAAA,QACvB,eAAe;AAAA,QACf,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,cAAc;AAAA,QACd,iBAAiB;AAAA,QACjB,gBAAgB;AAAA,QAChB,mBAAmB;AAAA,QACnB,eAAe;AAAA,MAAA;AAAA,IAEjB;AAAA,EACD;AACD;;"}
|
@@ -46,8 +46,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
46
46
|
PrismicEmbed: "https://oembed.wroom.io",
|
47
47
|
PrismicUnsplash: "https://unsplash.wroom.io/",
|
48
48
|
SliceMachineV1: "https://sm-api.wroom.io/v1/",
|
49
|
-
RepositoryService: "https://
|
50
|
-
LocaleService: "https://
|
49
|
+
RepositoryService: "https://repository.internal.wroom.io/",
|
50
|
+
LocaleService: "https://locale.internal.wroom.io/"
|
51
51
|
};
|
52
52
|
}
|
53
53
|
case APPLICATION_MODE.DevTools:
|
@@ -62,8 +62,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
62
62
|
PrismicEmbed: `https://oembed.${process.env.SM_ENV}-wroom.com`,
|
63
63
|
PrismicUnsplash: `https://unsplash.${process.env.SM_ENV}-wroom.com/`,
|
64
64
|
SliceMachineV1: `https://sm-api.${process.env.SM_ENV}-wroom.com/v1/`,
|
65
|
-
RepositoryService: `https://
|
66
|
-
LocaleService: `https://
|
65
|
+
RepositoryService: `https://repository.internal.${process.env.SM_ENV}-wroom.com/`,
|
66
|
+
LocaleService: `https://locale.internal.${process.env.SM_ENV}-wroom.com/`
|
67
67
|
};
|
68
68
|
}
|
69
69
|
case APPLICATION_MODE.Production:
|
@@ -77,8 +77,8 @@ If you didn't intend to run Slice Machine this way, stop it immediately and unse
|
|
77
77
|
PrismicEmbed: "https://oembed.prismic.io",
|
78
78
|
PrismicUnsplash: "https://unsplash.prismic.io/",
|
79
79
|
SliceMachineV1: "https://sm-api.prismic.io/v1/",
|
80
|
-
RepositoryService: "https://
|
81
|
-
LocaleService: "https://
|
80
|
+
RepositoryService: "https://repository.internal.prismic.io/",
|
81
|
+
LocaleService: "https://locale.internal.prismic.io/"
|
82
82
|
};
|
83
83
|
}
|
84
84
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"API_ENDPOINTS.js","sources":["../../../src/constants/API_ENDPOINTS.ts"],"sourcesContent":["import { addTrailingSlash, removeTrailingSlash } from \"../lib/trailingSlash\";\nimport { APPLICATION_MODE } from \"./APPLICATION_MODE\";\n\nexport type APIEndpoints = {\n\tPrismicWroom: string;\n\tPrismicAuthentication: string;\n\tPrismicModels: string;\n\tPrismicUser: string;\n\tAwsAclProvider: string;\n\tPrismicEmbed: string;\n\tPrismicUnsplash: string;\n\tSliceMachineV1: string;\n\tRepositoryService: string;\n\tLocaleService: string;\n};\n\nexport const API_ENDPOINTS: APIEndpoints = (() => {\n\tswitch (process.env.SM_ENV) {\n\t\tcase APPLICATION_MODE.Development: {\n\t\t\tconst apiEndpoints = {\n\t\t\t\tPrismicWroom: addTrailingSlash(process.env.wroom_endpoint),\n\t\t\t\tPrismicAuthentication: addTrailingSlash(\n\t\t\t\t\tprocess.env.authentication_server_endpoint,\n\t\t\t\t),\n\t\t\t\tPrismicModels: addTrailingSlash(process.env.customtypesapi_endpoint),\n\t\t\t\tPrismicUser: addTrailingSlash(process.env.user_service_endpoint),\n\t\t\t\tAwsAclProvider: addTrailingSlash(process.env.acl_provider_endpoint),\n\t\t\t\tPrismicEmbed: removeTrailingSlash(\n\t\t\t\t\tprocess.env.oembed_endpoint ?? \"https://oembed.wroom.io\",\n\t\t\t\t),\n\t\t\t\tPrismicUnsplash: addTrailingSlash(\n\t\t\t\t\tprocess.env.unsplash_endpoint ?? \"https://unsplash.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tSliceMachineV1: addTrailingSlash(\n\t\t\t\t\tprocess.env.slice_machine_v1_endpoint ??\n\t\t\t\t\t\t\"https://sm-api.wroom.io/v1/\",\n\t\t\t\t),\n\t\t\t\tRepositoryService: addTrailingSlash(\n\t\t\t\t\tprocess.env.repository_api ?? \"https://repository.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tLocaleService: addTrailingSlash(\n\t\t\t\t\tprocess.env.locale_api ?? \"https://locale.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tconst missingAPIEndpoints = Object.keys(apiEndpoints).filter((key) => {\n\t\t\t\treturn !apiEndpoints[key as keyof typeof apiEndpoints];\n\t\t\t});\n\n\t\t\tif (missingAPIEndpoints.length > 0) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t\t\t}) where API endpoints are configured via environment variables.\n\nThe following endpoints were not configured: ${missingAPIEndpoints.join(\", \")}.\n\nConfigure them before continuing.`,\n\t\t\t\t);\n\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconsole.warn(`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t}).\n\nThe following API endpoints were configured via environment variables:\n${Object.entries(apiEndpoints)\n\t.map(([name, endpoint]) => ` - ${name}: ${endpoint}`)\n\t.join(\"\\n\")}\n\nThese endpoints are different than Slice Machine's normal endpoints and are not trusted.\n\nIf you didn't intend to run Slice Machine this way, stop it immediately and unset the SM_ENV environment variable.`);\n\n\t\t\treturn apiEndpoints as APIEndpoints;\n\t\t}\n\n\t\tcase APPLICATION_MODE.Staging: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://wroom.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.wroom.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.wroom.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.wroom.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.wroom.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.wroom.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.wroom.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.wroom.io/v1/\",\n\t\t\t\tRepositoryService: \"https://
|
1
|
+
{"version":3,"file":"API_ENDPOINTS.js","sources":["../../../src/constants/API_ENDPOINTS.ts"],"sourcesContent":["import { addTrailingSlash, removeTrailingSlash } from \"../lib/trailingSlash\";\nimport { APPLICATION_MODE } from \"./APPLICATION_MODE\";\n\nexport type APIEndpoints = {\n\tPrismicWroom: string;\n\tPrismicAuthentication: string;\n\tPrismicModels: string;\n\tPrismicUser: string;\n\tAwsAclProvider: string;\n\tPrismicEmbed: string;\n\tPrismicUnsplash: string;\n\tSliceMachineV1: string;\n\tRepositoryService: string;\n\tLocaleService: string;\n};\n\nexport const API_ENDPOINTS: APIEndpoints = (() => {\n\tswitch (process.env.SM_ENV) {\n\t\tcase APPLICATION_MODE.Development: {\n\t\t\tconst apiEndpoints = {\n\t\t\t\tPrismicWroom: addTrailingSlash(process.env.wroom_endpoint),\n\t\t\t\tPrismicAuthentication: addTrailingSlash(\n\t\t\t\t\tprocess.env.authentication_server_endpoint,\n\t\t\t\t),\n\t\t\t\tPrismicModels: addTrailingSlash(process.env.customtypesapi_endpoint),\n\t\t\t\tPrismicUser: addTrailingSlash(process.env.user_service_endpoint),\n\t\t\t\tAwsAclProvider: addTrailingSlash(process.env.acl_provider_endpoint),\n\t\t\t\tPrismicEmbed: removeTrailingSlash(\n\t\t\t\t\tprocess.env.oembed_endpoint ?? \"https://oembed.wroom.io\",\n\t\t\t\t),\n\t\t\t\tPrismicUnsplash: addTrailingSlash(\n\t\t\t\t\tprocess.env.unsplash_endpoint ?? \"https://unsplash.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tSliceMachineV1: addTrailingSlash(\n\t\t\t\t\tprocess.env.slice_machine_v1_endpoint ??\n\t\t\t\t\t\t\"https://sm-api.wroom.io/v1/\",\n\t\t\t\t),\n\t\t\t\tRepositoryService: addTrailingSlash(\n\t\t\t\t\tprocess.env.repository_api ?? \"https://repository.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t\tLocaleService: addTrailingSlash(\n\t\t\t\t\tprocess.env.locale_api ?? \"https://locale.internal.wroom.io/\",\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tconst missingAPIEndpoints = Object.keys(apiEndpoints).filter((key) => {\n\t\t\t\treturn !apiEndpoints[key as keyof typeof apiEndpoints];\n\t\t\t});\n\n\t\t\tif (missingAPIEndpoints.length > 0) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t\t\t}) where API endpoints are configured via environment variables.\n\nThe following endpoints were not configured: ${missingAPIEndpoints.join(\", \")}.\n\nConfigure them before continuing.`,\n\t\t\t\t);\n\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconsole.warn(`You are running Slice Machine in development mode (SM_ENV=${\n\t\t\t\tAPPLICATION_MODE.Development\n\t\t\t}).\n\nThe following API endpoints were configured via environment variables:\n${Object.entries(apiEndpoints)\n\t.map(([name, endpoint]) => ` - ${name}: ${endpoint}`)\n\t.join(\"\\n\")}\n\nThese endpoints are different than Slice Machine's normal endpoints and are not trusted.\n\nIf you didn't intend to run Slice Machine this way, stop it immediately and unset the SM_ENV environment variable.`);\n\n\t\t\treturn apiEndpoints as APIEndpoints;\n\t\t}\n\n\t\tcase APPLICATION_MODE.Staging: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://wroom.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.wroom.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.wroom.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.wroom.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.wroom.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.wroom.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.wroom.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.wroom.io/v1/\",\n\t\t\t\tRepositoryService: \"https://repository.internal.wroom.io/\",\n\t\t\t\tLocaleService: \"https://locale.internal.wroom.io/\",\n\t\t\t};\n\t\t}\n\n\t\tcase APPLICATION_MODE.DevTools:\n\t\tcase APPLICATION_MODE.MarketingTools:\n\t\tcase APPLICATION_MODE.Platform: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: `https://${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicAuthentication: `https://auth.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicModels: `https://customtypes.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicUser: `https://user-service.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tAwsAclProvider: `https://acl-provider.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tPrismicEmbed: `https://oembed.${process.env.SM_ENV}-wroom.com`,\n\t\t\t\tPrismicUnsplash: `https://unsplash.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tSliceMachineV1: `https://sm-api.${process.env.SM_ENV}-wroom.com/v1/`,\n\t\t\t\tRepositoryService: `https://repository.internal.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t\tLocaleService: `https://locale.internal.${process.env.SM_ENV}-wroom.com/`,\n\t\t\t};\n\t\t}\n\n\t\tcase APPLICATION_MODE.Production:\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tPrismicWroom: \"https://prismic.io/\",\n\t\t\t\tPrismicAuthentication: \"https://auth.prismic.io/\",\n\t\t\t\tPrismicModels: \"https://customtypes.prismic.io/\",\n\t\t\t\tPrismicUser: \"https://user-service.prismic.io/\",\n\t\t\t\tAwsAclProvider: \"https://acl-provider.prismic.io/\",\n\t\t\t\tPrismicEmbed: \"https://oembed.prismic.io\",\n\t\t\t\tPrismicUnsplash: \"https://unsplash.prismic.io/\",\n\t\t\t\tSliceMachineV1: \"https://sm-api.prismic.io/v1/\",\n\t\t\t\tRepositoryService: \"https://repository.internal.prismic.io/\",\n\t\t\t\tLocaleService: \"https://locale.internal.prismic.io/\",\n\t\t\t};\n\t\t}\n\t}\n})();\n"],"names":[],"mappings":";;AAgBO,MAAM,iBAA+B,MAAK;AACxC,UAAA,QAAQ,IAAI,QAAQ;AAAA,IAC3B,KAAK,iBAAiB,aAAa;AAClC,YAAM,eAAe;AAAA,QACpB,cAAc,iBAAiB,QAAQ,IAAI,cAAc;AAAA,QACzD,uBAAuB,iBACtB,QAAQ,IAAI,8BAA8B;AAAA,QAE3C,eAAe,iBAAiB,QAAQ,IAAI,uBAAuB;AAAA,QACnE,aAAa,iBAAiB,QAAQ,IAAI,qBAAqB;AAAA,QAC/D,gBAAgB,iBAAiB,QAAQ,IAAI,qBAAqB;AAAA,QAClE,cAAc,oBACb,QAAQ,IAAI,mBAAmB,yBAAyB;AAAA,QAEzD,iBAAiB,iBAChB,QAAQ,IAAI,qBAAqB,4BAA4B;AAAA,QAE9D,gBAAgB,iBACf,QAAQ,IAAI,6BACX,6BAA6B;AAAA,QAE/B,mBAAmB,iBAClB,QAAQ,IAAI,kBAAkB,uCAAuC;AAAA,QAEtE,eAAe,iBACd,QAAQ,IAAI,cAAc,mCAAmC;AAAA,MAAA;AAI/D,YAAM,sBAAsB,OAAO,KAAK,YAAY,EAAE,OAAO,CAAC,QAAO;AAC7D,eAAA,CAAC,aAAa,GAAgC;AAAA,MAAA,CACrD;AAEG,UAAA,oBAAoB,SAAS,GAAG;AAC3B,gBAAA,MACP,6DACC,iBAAiB;AAAA;AAAA,+CAGwB,oBAAoB,KAAK,IAAI;AAAA;AAAA,kCAE1C;AAG9B,gBAAQ,KAAK,CAAC;AAAA,MACf;AAEQ,cAAA,KAAK,6DACZ,iBAAiB;AAAA;AAAA;AAAA,EAInB,OAAO,QAAQ,YAAY,EAC3B,IAAI,CAAC,CAAC,MAAM,QAAQ,MAAM,OAAO,SAAS,UAAU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