@itm-studio/partner-sdk 0.2.8 → 0.2.10

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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -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.8",
3
+ "version": "0.2.10",
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
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
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",
@@ -15,6 +15,23 @@ enum MomentStatus {
15
15
  ENDED
16
16
  }
17
17
 
18
+ enum BrandAgentEmailSendBatchStatus {
19
+ PENDING
20
+ SENDING
21
+ SENT
22
+ PARTIAL
23
+ FAILED
24
+ UNKNOWN
25
+ }
26
+
27
+ enum BrandAgentEmailSendMessageStatus {
28
+ PENDING
29
+ SENDING
30
+ SENT
31
+ FAILED
32
+ UNKNOWN
33
+ }
34
+
18
35
  enum MomentSortOrder {
19
36
  ASC
20
37
  DESC
@@ -498,7 +515,12 @@ type PartnerCustomer {
498
515
  }
499
516
 
500
517
  type PartnerMomentStats {
518
+ generatedAt: DateTime!
501
519
  ticketsCount: Int!
520
+ """Confirmed tickets whose materialized price is greater than zero."""
521
+ paidTicketsCount: Int!
522
+ """Confirmed tickets whose materialized price is zero."""
523
+ freeTicketsCount: Int!
502
524
  waitlistCount: Int!
503
525
  externalRsvpCount: Int!
504
526
  ticketRsvpRequestsCount: Int!
@@ -943,14 +965,53 @@ type MomentLineupResponseResult {
943
965
  success: Boolean!
944
966
  }
945
967
 
968
+ input PartnerMomentsFiltersInput {
969
+ """
970
+ Case-insensitive search over moment name and slug. Whitespace-only values are ignored.
971
+ """
972
+ search: String
973
+
974
+ """
975
+ When true, includes private moments owned by the authenticated brand. Default: false.
976
+ """
977
+ includePrivate: Boolean
978
+ }
979
+
946
980
  # ─── Queries ─────────────────────────────────────────────────────────────────
947
981
 
982
+ type BrandAgentEmailSendMessage {
983
+ uid: String!
984
+ position: Int!
985
+ recipient: String!
986
+ subject: String!
987
+ text: String!
988
+ status: BrandAgentEmailSendMessageStatus!
989
+ agentMailMessageId: String
990
+ agentMailThreadId: String
991
+ sentAt: DateTime
992
+ failedAt: DateTime
993
+ lastErrorCode: String
994
+ lastErrorMessage: String
995
+ }
996
+
997
+ type BrandAgentEmailSendBatch {
998
+ uid: String!
999
+ createdAt: DateTime!
1000
+ status: BrandAgentEmailSendBatchStatus!
1001
+ senderEmailAddress: String!
1002
+ acceptedCount: Int!
1003
+ messages: [BrandAgentEmailSendMessage!]!
1004
+ }
1005
+
948
1006
  type Query {
949
1007
  """
950
1008
  Get details for the brand associated with the partner token.
951
1009
  """
952
1010
  getPartnerBrand: PartnerBrand!
953
1011
 
1012
+ """Retrieve one AgentMail send batch owned by the authenticated partner brand."""
1013
+ getPartnerAgentEmailBatch(batchUid: String!): BrandAgentEmailSendBatch!
1014
+
954
1015
  """
955
1016
  Get paginated moments for the brand associated with the partner token.
956
1017
  """
@@ -959,6 +1020,7 @@ type Query {
959
1020
  cursor: String
960
1021
  take: Int
961
1022
  status: MomentStatus
1023
+ filters: PartnerMomentsFiltersInput
962
1024
  """Sort order for moments by start date (default: DESC - newest to oldest)"""
963
1025
  sortOrder: MomentSortOrder
964
1026
  ): GetPublicMomentsResponse!
@@ -1084,6 +1146,20 @@ input DimensionsInput {
1084
1146
  height: Float!
1085
1147
  }
1086
1148
 
1149
+ input BrandAgentEmailMessageInput {
1150
+ """One normalized recipient. Each item is sent as a separate email."""
1151
+ to: String!
1152
+ subject: String!
1153
+ text: String!
1154
+ }
1155
+
1156
+ input SendPartnerAgentEmailInput {
1157
+ """Stable business idempotency key for this logical batch."""
1158
+ idempotencyKey: String!
1159
+ """One to ten personalized, single-recipient plain-text emails."""
1160
+ messages: [BrandAgentEmailMessageInput!]!
1161
+ }
1162
+
1087
1163
  input VenueInput {
1088
1164
  name: String!
1089
1165
  city: String!
@@ -1405,6 +1481,11 @@ type Mutation {
1405
1481
  """
1406
1482
  createPartnerMoment(input: CreatePartnerMomentInput!): Moment!
1407
1483
 
1484
+ """Queue one to ten emails from the authenticated brand's AgentMail inbox."""
1485
+ sendPartnerAgentEmail(
1486
+ input: SendPartnerAgentEmailInput!
1487
+ ): BrandAgentEmailSendBatch!
1488
+
1408
1489
  """
1409
1490
  Bulk edit partner-owned ticket tiers for a moment.
1410
1491
  Supports per-tier price, facility-fee, and supply updates.