@itm-studio/partner-sdk 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +50 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -25
- package/dist/index.mjs.map +1 -1
- package/dist/unsupported-runtime.d.mts +2 -0
- package/dist/unsupported-runtime.d.ts +2 -0
- package/dist/unsupported-runtime.js +9 -0
- package/dist/unsupported-runtime.js.map +1 -0
- package/dist/unsupported-runtime.mjs +7 -0
- package/dist/unsupported-runtime.mjs.map +1 -0
- package/package.json +15 -3
- package/schema/partner.graphql +8 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/runtime.ts
|
|
4
|
+
var NODE_SERVER_ONLY_ERROR = "ITM Partner SDK is Node-server-only. Do not import it in browser, React Native, worker, edge, or Electron process code. Call it from a Node backend and return only the data the client needs.";
|
|
5
|
+
|
|
6
|
+
// src/unsupported-runtime.ts
|
|
7
|
+
throw new Error(NODE_SERVER_ONLY_ERROR);
|
|
8
|
+
//# sourceMappingURL=unsupported-runtime.js.map
|
|
9
|
+
//# sourceMappingURL=unsupported-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime.ts","../src/unsupported-runtime.ts"],"names":[],"mappings":";;;AAAO,IAAM,sBAAA,GACX,gMAAA;;;ACCF,MAAM,IAAI,MAAM,sBAAsB,CAAA","file":"unsupported-runtime.js","sourcesContent":["export const NODE_SERVER_ONLY_ERROR =\n 'ITM Partner SDK is Node-server-only. Do not import it in browser, React Native, worker, edge, or Electron process code. Call it from a Node backend and return only the data the client needs.';\n\ninterface RuntimeGlobals {\n process?: {\n release?: { name?: string };\n versions?: { node?: string; electron?: string };\n type?: string;\n };\n window?: unknown;\n navigator?: { product?: string };\n}\n\n/**\n * Enforce the SDK's Node-server-only credential boundary.\n *\n * Conditional package exports reject supported client bundlers before this\n * runs. This assertion protects direct artifact imports and legacy resolvers.\n */\nexport function assertNodeServerRuntime(\n runtime: RuntimeGlobals = globalThis as RuntimeGlobals,\n): void {\n const runtimeProcess = runtime.process;\n const isNode =\n runtimeProcess?.release?.name === 'node' &&\n typeof runtimeProcess.versions?.node === 'string';\n const isBrowserWindow = typeof runtime.window !== 'undefined';\n const isReactNative = runtime.navigator?.product === 'ReactNative';\n const isElectron =\n typeof runtimeProcess?.versions?.electron === 'string' ||\n typeof runtimeProcess?.type === 'string';\n\n if (!isNode || isBrowserWindow || isReactNative || isElectron) {\n throw new Error(NODE_SERVER_ONLY_ERROR);\n }\n}\n","import { NODE_SERVER_ONLY_ERROR } from './runtime';\n\nthrow new Error(NODE_SERVER_ONLY_ERROR);\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/runtime.ts
|
|
2
|
+
var NODE_SERVER_ONLY_ERROR = "ITM Partner SDK is Node-server-only. Do not import it in browser, React Native, worker, edge, or Electron process code. Call it from a Node backend and return only the data the client needs.";
|
|
3
|
+
|
|
4
|
+
// src/unsupported-runtime.ts
|
|
5
|
+
throw new Error(NODE_SERVER_ONLY_ERROR);
|
|
6
|
+
//# sourceMappingURL=unsupported-runtime.mjs.map
|
|
7
|
+
//# sourceMappingURL=unsupported-runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime.ts","../src/unsupported-runtime.ts"],"names":[],"mappings":";AAAO,IAAM,sBAAA,GACX,gMAAA;;;ACCF,MAAM,IAAI,MAAM,sBAAsB,CAAA","file":"unsupported-runtime.mjs","sourcesContent":["export const NODE_SERVER_ONLY_ERROR =\n 'ITM Partner SDK is Node-server-only. Do not import it in browser, React Native, worker, edge, or Electron process code. Call it from a Node backend and return only the data the client needs.';\n\ninterface RuntimeGlobals {\n process?: {\n release?: { name?: string };\n versions?: { node?: string; electron?: string };\n type?: string;\n };\n window?: unknown;\n navigator?: { product?: string };\n}\n\n/**\n * Enforce the SDK's Node-server-only credential boundary.\n *\n * Conditional package exports reject supported client bundlers before this\n * runs. This assertion protects direct artifact imports and legacy resolvers.\n */\nexport function assertNodeServerRuntime(\n runtime: RuntimeGlobals = globalThis as RuntimeGlobals,\n): void {\n const runtimeProcess = runtime.process;\n const isNode =\n runtimeProcess?.release?.name === 'node' &&\n typeof runtimeProcess.versions?.node === 'string';\n const isBrowserWindow = typeof runtime.window !== 'undefined';\n const isReactNative = runtime.navigator?.product === 'ReactNative';\n const isElectron =\n typeof runtimeProcess?.versions?.electron === 'string' ||\n typeof runtimeProcess?.type === 'string';\n\n if (!isNode || isBrowserWindow || isReactNative || isElectron) {\n throw new Error(NODE_SERVER_ONLY_ERROR);\n }\n}\n","import { NODE_SERVER_ONLY_ERROR } from './runtime';\n\nthrow new Error(NODE_SERVER_ONLY_ERROR);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itm-studio/partner-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "TypeScript SDK for the ITM Partner API — typed GraphQL client with zero introspection required",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,10 +8,20 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"browser": null,
|
|
12
|
+
"react-native": null,
|
|
13
|
+
"node": {
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"default": null
|
|
13
18
|
}
|
|
14
19
|
},
|
|
20
|
+
"browser": {
|
|
21
|
+
"./dist/index.js": "./dist/unsupported-runtime.js",
|
|
22
|
+
"./dist/index.mjs": "./dist/unsupported-runtime.mjs"
|
|
23
|
+
},
|
|
24
|
+
"react-native": "./dist/unsupported-runtime.js",
|
|
15
25
|
"files": [
|
|
16
26
|
"dist",
|
|
17
27
|
"schema"
|
|
@@ -20,6 +30,7 @@
|
|
|
20
30
|
"generate": "genql --schema ./schema/partner.graphql --output ./src/generated",
|
|
21
31
|
"build": "npm run generate && tsup",
|
|
22
32
|
"test": "vitest run",
|
|
33
|
+
"test:package-guards": "node scripts/verify-runtime-guards.mjs",
|
|
23
34
|
"test:watch": "vitest",
|
|
24
35
|
"lint": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
|
|
25
36
|
"prepublishOnly": "npm run build",
|
|
@@ -38,6 +49,7 @@
|
|
|
38
49
|
"devDependencies": {
|
|
39
50
|
"@genql/cli": "^6.3.3",
|
|
40
51
|
"@graphql-hive/cli": "^0.46.0",
|
|
52
|
+
"esbuild": "0.27.3",
|
|
41
53
|
"msw": "^2.7.0",
|
|
42
54
|
"tsup": "^8.4.0",
|
|
43
55
|
"typescript": "^5.7.0",
|
package/schema/partner.graphql
CHANGED
|
@@ -943,6 +943,13 @@ type MomentLineupResponseResult {
|
|
|
943
943
|
success: Boolean!
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
+
input PartnerMomentsFiltersInput {
|
|
947
|
+
"""
|
|
948
|
+
When true, includes private moments owned by the authenticated brand. Default: false.
|
|
949
|
+
"""
|
|
950
|
+
includePrivate: Boolean
|
|
951
|
+
}
|
|
952
|
+
|
|
946
953
|
# ─── Queries ─────────────────────────────────────────────────────────────────
|
|
947
954
|
|
|
948
955
|
type Query {
|
|
@@ -959,6 +966,7 @@ type Query {
|
|
|
959
966
|
cursor: String
|
|
960
967
|
take: Int
|
|
961
968
|
status: MomentStatus
|
|
969
|
+
filters: PartnerMomentsFiltersInput
|
|
962
970
|
"""Sort order for moments by start date (default: DESC - newest to oldest)"""
|
|
963
971
|
sortOrder: MomentSortOrder
|
|
964
972
|
): GetPublicMomentsResponse!
|